Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363016 - [Xtend] support for field initializers
Summary: [Xtend] support for field initializers
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.1.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-07 02:31 EST by Sven Efftinge CLA
Modified: 2017-09-19 17:05 EDT (History)
1 user (show)

See Also:
sven.efftinge: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Efftinge CLA 2011-11-07 02:31:04 EST

    
Comment 1 Sven Efftinge CLA 2011-11-12 07:04:50 EST
The syntax is going to be just like in Java, with the difference that you can write anything there because in Xtend statements doesn't exist:

class MyClass {
  
  String name = "Horst"

  String greeting = "Hello "+name

}
Comment 2 Sebastian Zarnekow CLA 2011-11-22 13:30:30 EST
Type inference for fields would be syntactically ambigious:

extension TypeName typeNameOrFieldName = "initialValue"

vs

extension TypeName
typeNameOrFieldName = "initialValue"

thus I'll use a mandatory type for now:

extension TypeName 
TypeName typeNameOrFieldName = "initialValue"
Comment 3 Sebastian Zarnekow CLA 2011-11-28 05:55:59 EST
Pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 16:54:53 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:05:43 EDT
Closing all bugs that were set to RESOLVED before Neon.0