| Summary: | Implicit variable in closure need to error in blocks | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Benjamin Schwertfeger <benjamin.schwertfeger> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | christian.dietrich.opensource, sebastian.zarnekow |
| Version: | 2.0.1 | Flags: | sebastian.zarnekow:
indigo+
|
| Target Milestone: | SR1 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
The following snippet leads to an error in the xtend file if it's added to the domainmodel generator. The first e.name is ok, but the one after after the equals sign is not recognized. def void forEachError(Entity p) { { p.features.forEach(e|{ e.name=e.name.toFirstLower() true }) p } } Workaround: Add the type to the closure: def void forallError(Entity p) { { p.features.forall(Feature e|{ e.name=e.name.toFirstLower() true }) p } }