Community
Participate
Working Groups
Now that we allow having a second implicit variable, it makes even more sense to allow invocation of extension methods on 'this' and 'it'. This is especially interesting for Xtend. Example: class MyXtendClass { def prependHello(String myString) { 'Hello '+myString } def testExtensionMethods() { val it = 'World' // currently we have to write it.prependHello // it should be possible to omit the receiver prependHello // doesn't work at the moment } } Not that, if both 'this' and 'it' are compatible to the same extension method the implicit is bound to 'it'.
Concrete syntax: featureCall() possible resolutions (ordered): it.featureCall() this.featureCall() extension.featureCall() Static.featureCall() this.featureCall(it) extension.featureCall(it) Static.featureCall(it) ==================================== Concreate syntax: that.featureCall() possible resolutions (ordered): that.featureCall() this.featureCall(that) extension.featureCall(that) Static.featureCall(that)
First shot pushed to master. There's still some remaining work for the feature / sugar precedencies.
Pushed to master.
Closing all bugs that were set to RESOLVED before Neon.0