Community
Participate
Working Groups
For the following Xtend2 class: class Other<T> { def bar((T)=>Object o) { o.apply(42) // <- obviously wrong } } the following illegal Java is generated: import org.eclipse.xtext.xbase.lib.Functions.Function1; @SuppressWarnings("all") public class Other<T extends Object> { public Object bar(final Function1<? super T,? extends Object> o) { Object _apply = o.apply(((Integer)42)); return _apply; } } There is no corresponding Xtend2 marker.
Interestingly enough Xtend properly reports an error marker by moving the generic type parameter to the method level: class Other { def <T> bar((T)=>Object o) { o.apply(new Integer(42)) // <- obviously wrong } } The error is then: "Incompatible types. Expected T but was java.lang.Integer".
Fixed in the meantime
Requested via bug 522520. -M.