Bug 137918 - [1.5][compiler] instanceof accepts primitive type as left-hand-side
Summary: [1.5][compiler] instanceof accepts primitive type as left-hand-side
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-21 06:41 EDT by Joachim Lusiardi CLA
Modified: 2006-04-28 14:57 EDT (History)
0 users

See Also:


Attachments

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