Can assign types even though interface field overriden using Omit #36604
Labels
Breaking Change
Would introduce errors in existing code
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Milestone
TypeScript Version: 3.7.5
Search Terms:
Omit field override intersection assign missing error
Expected behavior:
If I use Omit and an intersection to override a field within an interface, when I assign an object of new type to original type I am expecting that typescript would give an error.
For example, in the example below, I expect to see a compile error in the line
x = v;
But unfortunately there isn't.
However, assigning the field explicitly between the 2 types does give an error.
Playground Link: Provided
Actual behavior:
Code
Compiler Options
The text was updated successfully, but these errors were encountered: