TypeScript Version: 3.6.3
Search Terms: only setter in class implements interfaces. Interface property bugs.
Code
interface Properties {
val: number;
}
class BadProps implements Properties {
private _val: number = 42;
set val(newVal: number) {
this._val = newVal;
}
}
Expected behavior:
A type error that the implementing class is missing the getter.
Actual behavior:
Just runtime error of undefined.
Playground Link:
Above example
Related Issues: