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
interfaceSinglePropA{a: 'test-a'}interfaceSinglePropB{b: 'test-b'}typeAorB=|SinglePropA|SinglePropBconsttestAandB: AorB={a: 'test-a',b: 'test-bs'}// passes on 2.4.1 and 2.5.0-dev.20170629 consttestAandC: AorB={a: 'test-a',c: 'test-b'}// fails on 2.4.1 and 2.5.0-dev.20170629/* Object literal may only specify known properties, and 'c' does not exist in type 'SubsetAnimal'.*/
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Code
typescript playground example
Expected behavior:
Unions don't accept extra properties where the key matches another member of the union.
Actual behavior:
Unions accept extra properties where the key matches another member of the union but the value is incorrect.
Note. Came across this when trying to find a workaround for the following issue #17003
The text was updated successfully, but these errors were encountered: