Bug 471546 - [type computation] Wrong 'Bounds Mismatch' typing error
Summary: [type computation] Wrong 'Bounds Mismatch' typing error
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.9.0   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: 2015-07-01 04:16 EDT by Sven Efftinge CLA
Modified: 2016-06-10 05: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 Sven Efftinge CLA 2015-07-01 04:16:36 EDT
The following has a typing error, but shouldn't:

class MyClass<T extends CharSequence> {

	def void doStuff(MyClass<?> param) {
		someMethod(param) // error here
	}
	
	def <F extends CharSequence> void someMethod(MyClass<F> param) {}
}
Comment 1 Sebastian Zarnekow CLA 2015-07-01 04:45:42 EDT
Interestingly this valid JAva:

class MyClass<T extends CharSequence> {

    void doStuff(MyClass<? extends Object> param) {
        someMethod(param); // ? extends Object seems to be ? extends Object & CharSequence
    }

    <F extends CharSequence> void someMethod(MyClass<F> param) {}
}