Syntax for calling super
Brian Goetz
brian.goetz at oracle.com
Wed Aug 22 15:39:23 PDT 2012
> To my mind, the syntax "should" be K.m() (without the super). That makes
> sense to me because it's saying "use K's version of m()," but it's bad
> in that it looks like K.m is a static class (and perhaps more
> significantly, will be ambiguous should interfaces ever get static
> methods). So, I think K.super.m() is a good mix -- it's about the best I
> could imagine in a language where instance methods are always virtual. I
> read it as "treat 'this' as one of its super-classes, specifically K,
> when you invoke m."
K.m() was indeed considered, and rejected for exactly the reason you
outline.
More information about the lambda-dev
mailing list