Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370918 - Type conformance not checked
Summary: Type conformance not checked
Status: CLOSED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.3.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: 2012-02-08 04:11 EST by Sven Efftinge CLA
Modified: 2013-02-14 04:43 EST (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 2012-02-08 04:11:20 EST
Given the following Xtend code:
class XtendClass {
	
	@Test
	def void testMethod() {
		println(newArrayList('foo','bar','baz').toUpperCase)
	}
	
	def toUpperCase(Collection<String> allStrings) {
		allStrings.forEach[toUpperCase]
	}
}

the compiler generates :

  @Test
  public void testMethod() {
    ArrayList<String> _newArrayList = CollectionLiterals.<String>newArrayList("foo", "bar", "baz");
    this.toUpperCase(_newArrayList);
    InputOutput.<void>println(null);
  }

note 'void' is used as type parameter.
Comment 1 Sebastian Zarnekow CLA 2012-02-08 04:16:54 EST
IterableExtensions#forEach returns void thus I'd expect an error marker on the invocation of println
Comment 2 Dennis Huebner CLA 2013-02-14 04:43:26 EST
Fixed in the meanwhile.
Error marker says: Incompatible types. Expected Object but was void