Closed
Description
Bug Report
The child class should not be able to access the class field defined by the parent class via super
π Search Terms
class field super parent
π Version & Regression Information
Happens on 5.1.0-beta
β― Playground Link
Playground link with relevant code
π» Code
class T {
field = () => {}
}
class T2 extends T {
f() {
super.field()
// ~~~~~~~~~~~
}
}
new T2().f()
π Actual behavior
No type error
π Expected behavior
Type error.
super
will look for the parent class, but the class field is always defined on the current instance.