| Summary: | [xtend] Compiler generates bogus casts in dispatch method body | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sebastian Zarnekow <sebastian.zarnekow> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | Flags: | sebastian.zarnekow:
indigo+
|
| Version: | 2.1.0 | ||
| Target Milestone: | SR2 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
Try to implement a type provider with xtend: def dispatch type(XBinaryOperation bo, JvmTypeReference r, boolean b) { .. some impl .. } the generated code looks like this (formatting is applied manually in this bug report): public JvmTypeReference type( final XExpression binaryOperation, final JvmTypeReference rawExpectation, final boolean rawType) { if ((binaryOperation instanceof XBinaryOperation)) { <-- unnecessary parenthesis return _type( (XBinaryOperation)binaryOperation, <-- expected cast (JvmTypeReference)rawExpectation, <-- unexpected cast (Boolean)rawType <-- unnecessary boxing and unboxing due to cast ); } ..