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

Bug 345433

Summary: [xtend] problem with type inference
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: SR1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Moritz Eysholdt CLA 2011-05-11 10:45:47 EDT
the type of 

---
def unassignedCalledTokenRules() {
  grammar.containedRuleCalls.filter(e | !e.isAssigned() && !e.isEObjectRuleCall()).map(e | e.rule)
}
---

is resolved to Iterable<void>. It should be Iterable<AbstractRule>.

containedRuleCalls(), isAssigned() and isEObjectRuleCall() are imported via
import static extension org.eclipse.xtext.GrammarUtil.*
Comment 1 Jan Koehnlein CLA 2011-07-06 11:40:03 EDT
The type of e in the closure passed to the map cannot be resolved during linking (cannot resovlve reference to JvmIdentibiable element 'rule'), but is resolved later (hover shows correct type).
Comment 2 Sebastian Zarnekow CLA 2011-07-13 05:59:34 EDT
Added greenish tests org.eclipse.xtext.xtend2.tests.linking.LinkingTest.testBug345433*().
Comment 3 Karsten Thoms CLA 2017-09-19 17:17:40 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:29:00 EDT
Closing all bugs that were set to RESOLVED before Neon.0