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
Object literals with no contextual type use the type of the literal itself for this. However, when there is a contextual type, that gets used for this to the exclusion of the literal's own type. The type for this should actually be the intersection of the contextual type and the literal's own type.
this.m() should be of type D but is actually of type B.
I don't know how important this is; the current behaviour is pretty good but it did break a couple of times in our real-world code base. See comments on the original PR #14141 for details. MockJax and an Angular test broke.
The text was updated successfully, but these errors were encountered:
Object literals with no contextual type use the type of the literal itself for
this
. However, when there is a contextual type, that gets used forthis
to the exclusion of the literal's own type. The type forthis
should actually be the intersection of the contextual type and the literal's own type.this.m()
should be of typeD
but is actually of typeB
.I don't know how important this is; the current behaviour is pretty good but it did break a couple of times in our real-world code base. See comments on the original PR #14141 for details. MockJax and an Angular test broke.
The text was updated successfully, but these errors were encountered: