Bug 427246 - [xtend] Switch expression on int variable with Integer type guard compiles with an error
Summary: [xtend] Switch expression on int variable with Integer type guard compiles wi...
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.5.1   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-02-03 05:40 EST by Anton Kosyakov CLA
Modified: 2017-09-08 02:46 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kosyakov CLA 2014-02-03 05:40:00 EST
The following Xtend code compiles with an error:
switch x : 1 {
    Integer case 1: {
    }
}

Java error message: Incompatible conditional operand types int and Integer

For instanceof operator Xtend produces an error:
val int x = 1
//Incompatible conditional operand types int or Integer and Integer or int
if (x instanceof Integer) { 
}