Community
Participate
Working Groups
Try to implement a custom type provider with Xtend: def dispatch type(XBinaryOperation bo, JvmTypeReference r, boolean b) { if (true) throw new RuntimeException("This is expected") } this compiles to: protected JvmTypeReference _type(final XBinaryOperation bo, final JvmTypeReference r, final boolean b) { Object _xifexpression = null; <--- wrong type if (true) { RuntimeException _runtimeException = new RuntimeException("This is expected"); throw _runtimeException; } return _xifexpression; }
The given sample now raises the expected error Incompatible return type of dispatch method. Expected org.eclipse.xtext.common.types.JvmTypeReference but was void
Unfortunately this sample snippet reveals another problem: def dispatch type(XBinaryOperation bo, JvmTypeReference r, boolean b) { throw new RuntimeException("This is expected") } The same error is raised as with the initial example.
*** This bug has been marked as a duplicate of bug 361782 ***