Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366607 - [Xtend/Xbase] Wrong use of local type parameter
Summary: [Xtend/Xbase] Wrong use of local type parameter
Status: CLOSED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 376037
Blocks:
  Show dependency tree
 
Reported: 2011-12-13 14:13 EST by Sven Efftinge CLA
Modified: 2017-10-31 11:16 EDT (History)
2 users (show)

See Also:
sven.efftinge: kepler+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Efftinge CLA 2011-12-13 14:13:35 EST
def <T> T foo(Class<T> clazz) {
		val x = typeof(String).foo
		return null
	}

compiles to invalid Java code:

  public <T extends Object> T foo(final Class<T> clazz) {
      T _foo = this.<String>foo(java.lang.String.class);
      final T x = _foo;
      return null;
  }

_foo should be of type String
Comment 1 Dennis Huebner CLA 2013-02-14 04:03:39 EST
Works with the new TS
Comment 2 Eclipse Webmaster CLA 2017-10-31 11:05:02 EDT
Requested via bug 522520.

-M.
Comment 3 Eclipse Webmaster CLA 2017-10-31 11:16:25 EDT
Requested via bug 522520.

-M.