Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341304 - [xtend2] Undetected syntax problem in switch statement
Summary: [xtend2] Undetected syntax problem in switch statement
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 23:37 EDT by Karsten Thoms CLA
Modified: 2017-09-19 17:16 EDT (History)
1 user (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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