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
{{ message }}
Repository navigation
Excess properties in tagged union not checked if type is optional and literal #31655
That is, if I replace the optional string literal with an optional string, then it works as expected (I get an error for the excess prop href), suggesting this is down to the fact that we're using string literals?
changed the title [-]Excess properties in tagged union not checked if type is literal[/-][+]Excess properties in tagged union not checked if type is optional and literal[/+]on May 29, 2019
Right now the discriminable property check gives up if more than one type in the union matches any discriminant property. Unfortunately, type: 'submit' matches both Button.type and Anchor.type.
I'm going to try making the check stricter and see if it breaks anything.
Activity
[-]Excess properties in tagged union not checked if type is literal[/-][+]Excess properties in tagged union not checked if type is optional and literal[/+]RyanCavanaugh commentedon May 29, 2019
This works as expected if you turn strict null checks off 🙃
sandersn commentedon Aug 7, 2019
Right now the discriminable property check gives up if more than one type in the union matches any discriminant property. Unfortunately,
type: 'submit'matches both Button.type and Anchor.type.I'm going to try making the check stricter and see if it breaks anything.
Not sure why strictNullChecks makes this work.