Type Error in Combination with Discriminating Union #35700
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
TypeScript Version: 3.7.2
Search Terms: discriminating union, types incompatible, not assignable
Expected behavior:
The code should compile.
Actual behavior:
Related Issues: None found yet.
Code
Note that this is a reduced example. My real-world use case uses the
schema-dts
json-ld library which provides theVehicle
/Car
/etc. types.Interestingly, modifying the
Vehicle
type would make it compile (but I cannot do that in my real-world project because the types are provided by theschema-dts
json-ld library):Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: