Open masuhar opened 6 years ago
The cause of the problem:
super()
before using this
.this
.But changing the class D to this won't help:
class D extends C {
constructor(){ super(); }
}
Though this is a correct program, Kanon inserts checkpoints before super()
, which violates the use of thiis
before super()
.
Conclusion: we should fix the instrumentation algorithm to properly treat super
calls.
With this code
I get an error
Error?: |this| used uninitialized in D class constructor
It reminds me a restriction in Java, where you should write a call to the super-constructor at the beginning of a constructor. You are also not safe to access fields of
this
before finishing the call to the super-constructor.