| Summary: | [Xtend] generates wrong statements when using instanceof on a List element | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Serano Colameo <serano.colameo> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | mail, sebastian.zarnekow, sven.efftinge |
| Version: | unspecified | Flags: | sebastian.zarnekow:
indigo+
|
| Target Milestone: | SR2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
workaround:
def Model transform(List sources) {
val elem = sources.get(0)
if (elem instanceof InterfaceDcl) {
//...
}
}
This is still reproducable. 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 |
Build Identifier: 2.0.0.v201105101404 Input: def Model transform(List sources) { if (sources.get(9) instanceof InterfaceDcl) { println("This is an InterfaceDcl") } Output: public Model transform(final List sources) throws IllegalArgumentException { { ? _get = sources.get(9); if ((_get instanceof com.csg.cs.tools.mdgen.idl.idl.InterfaceDcl)) { InputOutput.<String>println("This is an InterfaceDcl"); } Reproducible: Always Steps to Reproduce: 1. create an Xtend2 class 2. define an if statement (see details) 3. check generated java class