Bug 137918

Summary: [1.5][compiler] instanceof accepts primitive type as left-hand-side
Product: [Eclipse Project] JDT Reporter: Joachim Lusiardi <shing19m>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Joachim Lusiardi CLA 2006-04-21 06:41:24 EDT
In the following code

int a = 100;
c = a instanceof Object;

eclipse does not mark any error or something and produces a class file.
The code is not runnable and produces a VerifierError because "a" is not an Object.

I used Build id: I20060413-1718 for this test
Comment 1 Philipe Mulet CLA 2006-04-21 08:54:16 EDT
Issue only arises in 1.5 mode, likely a consequence of autoboxing support.
Comment 2 Philipe Mulet CLA 2006-04-21 09:22:03 EDT
Added Autoboxing#test120.
Fixed InstanceOfExpression to disallow base type scenario.

Fixed
Comment 3 Olivier Thomann CLA 2006-04-28 14:57:05 EDT
Verified with I20060427-1600 for 3.2RC2