-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DT regression from Improved type inference for object literals #19613
Comments
var events = [
{id: 1, type: "add", val: 3},
{id: 2, type: "add", val: -1},
{id: 1, type: "add", val: 2},
{id: 2, type: "cancel"},
{id: 3, type: "add", val: 2},
{id: 3, type: "cancel"},
{id: 1, type: "add", val: 1},
{id: 1, type: "add", val: 2},
{id: 1, type: "cancel"}
];
seems like the new type is worse.. |
The new type is fine and in fact more correct. The real issue is that we don't consider BTW, it's interesting to observe that an object type with one or more properties that have union types should behave equivalently to a union of object types with all possible permutations of those property types. This of course expands exponentially, so real life scenarios typically only have one property for which the expansion takes place, and it may be that those are the only ones we really care about. |
@ahejlsberg The error in |
#14865 Is open to track this already. |
closing in favor of #14865 |
The three new errors in |
#19513 broke a DefinitelyTyped test. (Tested by building locally both with this commit and with the previous commit 4895d16) Go to
DefinitelyTyped/types/baconjs
and runtsc
to see the error.EDIT: Same for
d3-selection-multi
.It's hard to say what exactly changed. Something that used to be assignable is no longer assignable.
In
baconjs
the error is:In
d3-selection-multi
the error is:The text was updated successfully, but these errors were encountered: