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

Bug 368335

Summary: Operator mapping for primitives wrong since all the overloaded methods are there
Product: [Modeling] TMF Reporter: Ingo Meyer <ingo.meyer>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jan
Version: unspecifiedFlags: jan: juno+
Target Milestone: M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 367207    
Bug Blocks:    

Description Ingo Meyer CLA 2012-01-11 08:05:35 EST
Build Identifier: 20110609-2236

Scoping operators with primitives (as 2nd argument) will not choose the "best match" but the first compatible one, which is not correct for the Java TypeSystem.

Details: http://www.eclipse.org/forums/index.php/t/275743/

Reproducible: Always

Steps to Reproduce:
1. Use the following code:

op testLiteralsOperator
{
	// example 1
	var ^ok = 0			
	^ok = ^ok + 1
	
	// example 2
	val ^sec = 30000 			
	Thread::sleep( ^sec * 1000 )
}

2. You get wrong code then:
{
	int ok = 0;
	double _operator_plus = IntegerExtensions.operator_plus( ok, 1 );
	ok = _operator_plus;
	final int sec = 30000;
	double _operator_multiply = IntegerExtensions.operator_multiply( sec, 1000 );
	Thread.sleep( _operator_multiply );
}
3.
Comment 1 Jan Koehnlein CLA 2012-01-17 10:22:14 EST
That's already been fixed with bug 367207 in MASTER.
Comment 2 Karsten Thoms CLA 2017-09-19 18:04:22 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:14:26 EDT
Closing all bugs that were set to RESOLVED before Neon.0