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

Bug 343582

Summary: [xbase] switch to primitive types neither works nor flagged as error
Product: [Modeling] TMF Reporter: Niko Stotz <eclipse>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, sven.efftinge
Version: 2.0.0Flags: sven.efftinge: indigo+
Target Milestone: SR1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Niko Stotz CLA 2011-04-21 12:31:05 EDT
Build Identifier: I20110310-1119

Primitive types are usable in a type switch, but do not work. They should either work or be flagged as error.

Reproducible: Always

Steps to Reproduce:
(plain copy from Tutorial.xbase)

var list = newArrayList(true, 4, "123", newArrayList(5, 6))
list.map(e | 
switch(e) {
	int:
		"int"
	boolean:
		"boolean"
	String:
		"string"
	default:
		"dontknow"
})
// [dontknow, dontknow, string, dontknow] (List<String>)

list.map(e | 
switch(e) {
	Integer:
		"int"
	Boolean:
		"boolean"
	String:
		"string"
	default:
		"dontknow"
})
// [boolean, int, string, dontknow] (List<String>)
Comment 1 Sebastian Zarnekow CLA 2011-05-04 06:11:32 EDT
Preliminary scheduled for 2.0RC1
Comment 2 Sven Efftinge CLA 2011-05-04 09:59:05 EDT
postponed to SR1
Comment 3 Jan Koehnlein CLA 2011-07-06 09:40:04 EDT
Added a validation rule.
Comment 4 Karsten Thoms CLA 2017-09-19 16:57:14 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:08:30 EDT
Closing all bugs that were set to RESOLVED before Neon.0