-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Typing: soundnessNo false negatives (type checker claims that there is no error in the incorrect program)No false negatives (type checker claims that there is no error in the incorrect program)bug
Description
Try:
const o = { a: 1 };
o.a = 2;
(o: { a: 1 }); // Ok?!
I would have expected the assignment to have widened the deduced type for o
to { a: 1|2 }
or { a: number }
, thus causing the type assertion to fail. Instead, it passes.
Metadata
Metadata
Assignees
Labels
Typing: soundnessNo false negatives (type checker claims that there is no error in the incorrect program)No false negatives (type checker claims that there is no error in the incorrect program)bug