Bug 366666 - [Xbase][generator] nested upperbounds
Summary: [Xbase][generator] nested upperbounds
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.4.3   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-14 01:52 EST by Sven Efftinge CLA
Modified: 2013-09-16 13:24 EDT (History)
0 users

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 2011-12-14 01:52:57 EST
given a 'map' of type Map<String,? extends Object>, it's not possible to write the following
in Java :

Set<Entry<String, ? extends Object>> entrySet = mp.entrySet();

JDT suggests :

Set<?> entrySet = map.entrySet()

Xtend allows it, which results in invalid Java code (that's related to another bug, regarding cast conversions)

But in Java it's ok to write :

for (Entry<String, ? extends Object> x : mp.entrySet()) {

However, the Xtend compiler creates a local variable

Set<Entry<String, ? extends Object>> _entrySet = mp.entrySet();

which renders the code invalid.
Comment 1 Sven Efftinge CLA 2012-04-03 04:27:38 EDT
A solution would be to avoid generation of a synthetic local variable.