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
In 5.8.0, (this as Writable<this>).field = 4; would typecheck as expected with no errors, but in 5.9.0 it generates an error. <typeof this> also doesn't work.
classSomeClass{readonlyfield: number=3;method(){(thisasWritable<this>).field=4;// worked in 5.8.0, error in 5.9.0}}
Bug description
In
5.8.0,(this as Writable<this>).field = 4;would typecheck as expected with no errors, but in5.9.0it generates an error.<typeof this>also doesn't work.Repro
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3gdSsGBDAIwBsUBfOAMyghDgHIlUBaClAZxjoG4BYAKH4BjInjZs4AZRooAwiLEZ+ASCgo8AEwgA7IokrAURdQC44WgK4gCKKHAC8cAMy8BfJSBQwAFhHUAKAEpFNyVvYDYAOgoDIxclJQB6BLgUuAA9AH5lUK9wqJj1ezgAFi44JLgUAA9UQRgUQptqKGyK1MzsvzDxUThsXEISAB5ugD4A-MNCh1Ly5IB3aABrBrhgLTgAVgiADgiABgAaSqhmtY3tgE4D1uTU+4fHh46Qrtye8X78YhQR5BQIBQEO9xpMjEVZhU8EQ2BA4Jp2FoGHBFlAlrcnpisU8XkpSPx8a5BNoOOcOHgtII0A4tCh5pJpHJRGxAi51uTKSgweoXG1Hi92fhOdyIWUKtVavVGqdoPw+c8snw-IKKVS4L0voNfowAUCVZzQdEpqK5ijlh9KjUUHUGnK7tiHY77i9lVoOWqNThvsMpB4mWJDQUTVCYXDUUsLRLrVK7U64-zFUA