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
in the case of variable assignment it correctly highlights the unknownField and produces a nice error that says Object literal may only specify known properties, and 'unknownField' does not exist in type 'B'.
but in the case of the same value passed as a function argument (of the same type) it highlights the top-level field and a different, less readable error Type '({ a: number; } | { b: number; unknownField: number; })[]' is missing the following properties from type '[A, B]': 0, 1
am I missing something? is there a way to make sure I get the same error and highlighting in both cases?
in the following code
unknownField
and produces a nice error that saysObject literal may only specify known properties, and 'unknownField' does not exist in type 'B'.
Type '({ a: number; } | { b: number; unknownField: number; })[]' is missing the following properties from type '[A, B]': 0, 1
am I missing something? is there a way to make sure I get the same error and highlighting in both cases?
in typescript playground:
The text was updated successfully, but these errors were encountered: