Closed
Description
TypeScript Version: 3.7.2
Search Terms:
typescript property access super undefined
Code
class Base {
n = 3
}
class Foo extends Base {
test() {
console.log(super.n) // type system says it should be a number, but it is undefined
}
}
new Foo().test() // logs "undefined"
Expected behavior:
Should be some sort of type error, because clearly it is undefined
Actual behavior:
no error until runtime