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

Bug 343089

Summary: [xbase] [validation] too strict "incompatible types" check
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: M7   
Hardware: All   
OS: All   
Whiteboard:

Description Knut Wannheden CLA 2011-04-18 02:46:25 EDT
The following Xtend2 snippet:

	<T extends Integer> requiresCastOfOperand() {
		[T a,T b|a+b]
	}

results in a validation error for the right 'b' operand of the '+' expression: "Incompatible types. Expected java.lang.Number but was T".

Changing the snippet to read:

	<T extends Integer> requiresCastOfOperand() {
		[T a,T b|a+(b as Integer)]
	}

gets rid of the validation. But that shouldn't be necessary.
Comment 1 Sebastian Zarnekow CLA 2011-04-19 18:06:36 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 18:01:00 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:11:23 EDT
Closing all bugs that were set to RESOLVED before Neon.0