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
Hmm, not a great fan of this pattern, but I agree it is a regression we should fix. The cause of the issue is #30769, specifically that we now ignore index signatures in type parameter constraints on the target side of an assignment. We need to make an exception for this type parameters because actual type arguments are known to have an index signature (through inheritance).
TypeScript Version: 3.5.0-dev.20190517
Search Terms:
TS2536
Type cannot be used to index type 'this'.
Code
Expected behavior:
No errors
Actual behavior:
error TS2536: Type '"a"' cannot be used to index type 'this'.
Playground Link:
Works fine in playground but fails in 3.5.0.rc
https://www.typescriptlang.org/play/#src=class%20y%20%7B%0D%0A%20%20%20%20%5Bx%3A%20string%5D%3A%20string%3B%0D%0A%20%20%20%20constructor()%20%7B%0D%0A%20%20%20%20%20%20%20%20this%5B%22b%22%5D%20%3D%20%22a%22%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A
Related Issues:
Could not find any
The text was updated successfully, but these errors were encountered: