Why does this compile? (TS v2.0.3)
class SetterOnly {
set prop(v) {
let x = this.prop;
}
}
I would expect this.prop
to generate a compile-time error ...
This is a known issue: https://github.com/Microsoft/TypeScript/issues/814
We're definitely not bothering with write-only properties. This is not common enough to justify complicating the type system with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With