Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366607

Summary: [Xtend/Xbase] Wrong use of local type parameter
Product: [Tools] Xtend Reporter: Sven Efftinge <sven.efftinge>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dennis.huebner, sebastian.zarnekow
Version: 2.2.0Flags: sven.efftinge: kepler+
Target Milestone: M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 376037    
Bug Blocks:    

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.