Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345599 - [doc] Syntax for create functions is not correct
Summary: [doc] Syntax for create functions is not correct
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 09:32 EDT by Karsten Thoms CLA
Modified: 2017-09-19 17:08 EDT (History)
1 user (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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