Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345373

Summary: [Xtend] generates wrong statements when using instanceof on a List element
Product: [Modeling] TMF Reporter: Serano Colameo <serano.colameo>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: mail, sebastian.zarnekow, sven.efftinge
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Serano Colameo CLA 2011-05-11 04:12:36 EDT
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
Comment 1 Serano Colameo CLA 2011-05-11 04:14:55 EDT
workaround:
	def Model transform(List sources) {
		val elem = sources.get(0)
		if (elem instanceof InterfaceDcl) {
			//...
		}
         }
Comment 2 Sebastian Zarnekow CLA 2011-08-28 12:33:47 EDT
This is still reproducable.
Comment 3 Sebastian Zarnekow CLA 2011-09-28 10:18:27 EDT
Pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 17:06:20 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:18:13 EDT
Closing all bugs that were set to RESOLVED before Neon.0