Post
by lexikos » 16 Jul 2023, 21:10
What are you expecting it to do?
The whole point of super is that it is relative to the class which contains the method definition, not the runtime class of this. In your example there is no class associated with the function.
this is just a parameter and local variable, implicit for methods. If the function is called as a method, it will be passed this parameter. If a closure is defined inside a method, it can capture the method's this parameter. In that case, maybe super.method() could be made to work like (BaseClass.method)(this), but obviously you can already do the latter. And this doesn't apply to f in your example; that is just an ordinary global function.