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

Bug 341304

Summary: [xtend2] Undetected syntax problem in switch statement
Product: [Modeling] TMF Reporter: Karsten Thoms <karsten.thoms>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sven.efftinge
Version: 2.0.0Flags: sven.efftinge: indigo+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Karsten Thoms CLA 2011-03-29 23:37:46 EDT
The following function results to no validation error in an xtend file: 
	String test (Object o) {
		switch (o) {
			Entity : o.packageName + "." + o.name
			DataType : switch (o.name) {
				Entity : "foo" : "bar"
			}
		}
	}


The compiled Java code from this function has an compile error:
"Incompatible conditional operand types String and Entity"

        if (!matched_1) {
          if (__valOfSwitchOver instanceof Entity) {  // ERROR
            matched_1=true;
            switchResult_1 = "foo";
          }
        }
Comment 1 Sven Efftinge CLA 2011-03-30 10:58:39 EDT
pushed to master
Comment 2 Karsten Thoms CLA 2017-09-19 17:04:56 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:16:54 EDT
Closing all bugs that were set to RESOLVED before Neon.0