Community
Participate
Working Groups
class Foo { static def getDefault() {} } class Bar { def bar() { Foo.default // default is italics and marked as an error } } The error is 'no viable alternative' because 'default' is recognized as a keyword so the parser fails. Nevertheless the type system seems to be able to resolve the static feature call such that semantic highlighting is applied. This is quite confusing. Unfortunately, it happens quite often as a static getDefault() method is common for activators and is used often on Display. Workaround is of course to write ^default or getDefault. Content assist will insert the latter.
We should make 'default' a valid id and guide the parse with a predicate in the switch expression. If this appears to be the only grammar change that we want to apply to Xbase, I'd be in favor of doing that only for Xtend.