Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367843 - [Xbase] check instanceof expression
Summary: [Xbase] check instanceof expression
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.2.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-04 08:25 EST by Sven Efftinge CLA
Modified: 2017-09-19 18:02 EDT (History)
1 user (show)

See Also:
sven.efftinge: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Efftinge CLA 2012-01-04 08:25:52 EST
The instanceof expression must be validated to not use any primitives. 
Also the type on the left and the right should be validated like in Java (incompatible conditional operands).
Finally no conversion rules should be respected. That is

[| 'foo' ] instanceof Supplier<String> 

is *false* as well as

newArrayList('foo','bar') instanceof String[]
Comment 1 Sven Efftinge CLA 2012-01-04 08:27:21 EST
Array types should be allowed in instanceof expressions.
Comment 2 Sebastian Zarnekow CLA 2012-01-05 09:38:40 EST
In Java it's ok to check 

variable instanceof List<?>

I think Xtend should allow that, too
Comment 3 Sven Efftinge CLA 2012-01-05 11:24:21 EST
pushed to master
Comment 4 Karsten Thoms CLA 2017-09-19 17:51:59 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:02:43 EDT
Closing all bugs that were set to RESOLVED before Neon.0