Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343089 - [xbase] [validation] too strict "incompatible types" check
Summary: [xbase] [validation] too strict "incompatible types" check
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-18 02:46 EDT by Knut Wannheden CLA
Modified: 2017-09-19 18:11 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

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