Community
Participate
Working Groups
The following Xtend code: class Other { def bar() { true as String } } compiles to the illegal Java code: @SuppressWarnings("all") public class Other { public String bar() { return ((String) ((Boolean)true)); } } The same thing happend for expressions like "42 as String" etc.
Could be related: Compiling the following: public class Foo { def foo() { switch 123 { String case null : "foo" } } } results in an illegal instanceof expression: @SuppressWarnings("all") public class Foo { public String foo() { String _switchResult = null; final int __valOfSwitchOver = 123; boolean matched = false; if (!matched) { if (__valOfSwitchOver instanceof String) { if (ObjectExtensions.operator_equals(__valOfSwitchOver,null)) { matched=true; _switchResult = "foo"; } } } return _switchResult; } }
related to bug 342007 and bug 342431
*** This bug has been marked as a duplicate of bug 342007 ***