You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no error on the overrides field in the object. Changing the type of foo slightly (removing one of the intersections) causes the error to appear correctly, but this unique combination of types produces no error. Does not matter what the contents of OverridesInput is, nor what the content inside the outer partial (currently {something: any}) is. Additionally, the following all produce the error correctly:
interfaceUnrelated{_?: any}// Identical but distinct types.interfaceVariablesA{overrides?: OverridesInput;}interfaceVariablesB{overrides?: OverridesInput;}constfoo: Unrelated&{variables: VariablesA&VariablesB}={variables: {// Should be an error here:overrides: false}};
I would've expected some weak type checking on this one.
Bug Report
π Search Terms
partial nested object type
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
There is no error on the
overrides
field in the object. Changing the type offoo
slightly (removing one of the intersections) causes the error to appear correctly, but this unique combination of types produces no error. Does not matter what the contents ofOverridesInput
is, nor what the content inside the outer partial (currently{something: any}
) is. Additionally, the following all produce the error correctly:π Expected behavior
There should be an error on the
overrides
field of the object sincefalse
is not assignable toOverridesInput | undefined
.The text was updated successfully, but these errors were encountered: