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

Bug 345599

Summary: [doc] Syntax for create functions is not correct
Product: [Modeling] TMF Reporter: Karsten Thoms <karsten.thoms>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sven.efftinge
Version: 2.0.0Flags: sven.efftinge: indigo+
Target Milestone: RC1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Karsten Thoms CLA 2011-05-12 09:32:20 EDT
In the Xbase and Xtend doc it is not mentioned that the return type must be named and a colon is required.

def create new Person() copy(Person p) {
    name = p.name
    // now it works    
    friendWith = p.friendWith.map( p | p.copy )   
    marriedWith = p.marriedWith.map( p | p.copy ) 
} 


=>

def create target : new Person() copy(Person p) {
    target.name = p.name
    // now it works    
    target.friendWith = p.friendWith.map( p | p.copy )   
    target.marriedWith = p.marriedWith.map( p | p.copy ) 
}
Comment 1 Sven Efftinge CLA 2011-05-15 03:52:11 EDT
doc has already been updated
Comment 2 Karsten Thoms CLA 2017-09-19 16:57:43 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:08:59 EDT
Closing all bugs that were set to RESOLVED before Neon.0