Bug 409847 - missing type validation for assignments with generic types
Summary: missing type validation for assignments with generic types
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.4.2   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-04 09:35 EDT by Moritz Eysholdt CLA
Modified: 2013-06-04 10:12 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 Moritz Eysholdt CLA 2013-06-04 09:35:57 EDT
In Xtend, the following code produces no error

--------------
class Foo {
	Class<? extends Collection<?>> c =  ArrayList
}
--------------


The compiled Java code:
---------------
public class Foo {
  private Class<? extends Collection<? extends Object>> c = ArrayList.class;
}
----------------

doesn't compile because of error:
Type mismatch: cannot convert from Class<ArrayList> to Class<? extends Collection<? extends Object>>
Comment 1 Sebastian Zarnekow CLA 2013-06-04 10:10:53 EDT
Does this fail with typeof literals, too?
Comment 2 Moritz Eysholdt CLA 2013-06-04 10:12:51 EDT
(In reply to comment #1)
> Does this fail with typeof literals, too?

yes, i.e. no error in Xtend, but an error on the Java side.