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

Bug 358102

Summary: IRUtils.makeCompatible adds BoxingExpressions to enum comparison
Product: z_Archived Reporter: Matt Heitz <mheitz>
Component: EDTAssignee: Jeff Douglas <jeffdouglas>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: greer, jvincens
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matt Heitz CLA 2011-09-19 08:21:20 EDT
This causes several failures in Java in the testcase I wrote on Friday for the language enhancements about nullablity, arrays, and curly braces.  I expect it'll cause failures in JavaScript too.

IRUtils.makeCompatible(BinaryExpression expr, Type type1, Type type2) is boxing when we compare two enumeration values, but it shouldn't.  Here's a simple testcase.


package y;

program enums
	function main()
		ok1 OrderingKind = OrderingKind.byKey;
		ok2 OrderingKind = OrderingKind.byKey;
		if ( ok1 == ok2 )
			SysLib.writeStdout( "== worked" );
		else
			SysLib.writeStdout( "== failed" );
		end
		ok2 = OrderingKind.none;
		if ( ok1 != ok2 )
			SysLib.writeStdout( "!= failed" );
		else
			SysLib.writeStdout( "!= worked" );
		end
	end
end
Comment 1 Matt Heitz CLA 2011-09-20 09:03:43 EDT
*** Bug 358233 has been marked as a duplicate of this bug. ***
Comment 2 Jeff Douglas CLA 2011-09-21 11:04:44 EDT
fixed
Comment 3 Matt Heitz CLA 2011-10-04 14:30:23 EDT
Verified.