-
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
[Errors] Empty object contextually typed by type with indexer #48
Comments
The actual behavior here matches the spec. It appears to be by design. |
Another interesting example where we don't error, but probably should: var v: { [s: string]: string} = { This is a result of best common type losing information, and the nontransitivity of assignability. |
What's the action here? If we're aligned to spec, shouldn't this just be closed as by design? |
As I recall from discussion, the spec needs to be updated to align with the current behavior. Specifically, I think section 3.8.1 needs to not pull in call/construct/index signatures for the augmented types. And it is a breaking change. |
I'm confused. You mention earlier that the "actual behavior here matches the spec. It appears to be by design." If so, is there a spec change? |
Yeah my previous comments were wrong because I misunderstood what was going on. Ignore those. It needs a spec change per my recent comment. |
Before we make this change, please confirm that the change does not impact real world code before we make the spec change. |
Reopening this because the validation on real world code was not done yet. |
Doesn't break any real world code we know of. |
Is this fixed, or by design? |
Fixed, in that it is a change from the old compiler. Spec has been updated to reflect behavior of the new compiler. |
Expected: no errors
Actual: errors in the comments above
Verify test case:
tests/cases/compiler/augmentedTypeBracketAccessIndexSignature.ts
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts
The text was updated successfully, but these errors were encountered: