Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368335 - Operator mapping for primitives wrong since all the overloaded methods are there
Summary: Operator mapping for primitives wrong since all the overloaded methods are there
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 367207
Blocks:
  Show dependency tree
 
Reported: 2012-01-11 08:05 EST by Ingo Meyer CLA
Modified: 2017-09-19 18:14 EDT (History)
1 user (show)

See Also:
jan: juno+


Attachments

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