`(this as Writable<this>).field = ...` no longer works in `5.9.0`
Author: DayKevCreated Sep 4, 2026Updated Sep 4, 2026
Labelsbug
Bug description
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.
class SomeClass {
readonly field: number = 3;
method() {
(this as Writable<this>).field = 4; // worked in 5.8.0, error in 5.9.0
}
}Repro
Source: sindresorhus/type-fest