Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358418 - [Xtend] Method with generic type is compiled wrong
Summary: [Xtend] Method with generic type is compiled wrong
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-21 09:58 EDT by Ingo Meyer CLA
Modified: 2017-09-19 18:16 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ingo Meyer CLA 2011-09-21 09:58:24 EDT
Build Identifier: 20110609-2236

The following method will be wrong in Java:

	/**
	 * 
	 */
	def <T> Iterable<T> nullSafe (Iterable<T> elements) {
		if (elements == null)
			newArrayList
		else
			elements
	}

I use Xtext 2.0.1.v201108151710

Reproducible: Always
Comment 1 Sebastian Zarnekow CLA 2011-09-28 09:47:31 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 18:06:45 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:16:26 EDT
Closing all bugs that were set to RESOLVED before Neon.0