Bug 432163 - [typesystem] Missing validation error for incompatible type argument in Xtend
Summary: [typesystem] Missing validation error for incompatible type argument in Xtend
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.5.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-07 10:21 EDT by Jan Koehnlein CLA
Modified: 2014-04-09 07:57 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 Jan Koehnlein CLA 2014-04-07 10:21:55 EDT
In this scenario:

----8<------------
class Foo<T> {}

class Bar<T> extends Foo<T> {	
  def FooBar<T> getFooBar() { null }
}

class FooBar<T> {}

class Baz {
	
  def <T> foo(Foo<T> foo, T arg) {
    if(foo instanceof Bar<?>)
      baz(foo.fooBar, arg)  // error in Java code only
    }
	
  def <T> baz(FooBar<T> bar, T arg) {}
}
---->8------------

Xtend does not report a validation error, but Java does: "The method baz(FooBar<T>, T) in the type Baz is not applicable for the arguments (FooBar<capture#1-of ?>, T)"
Comment 1 Sebastian Zarnekow CLA 2014-04-09 07:57:23 EDT
see bug 432129