Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345934 - [Xtend/Xbase] Null save operator does not work correctly with extension methods
Summary: [Xtend/Xbase] Null save operator does not work correctly with extension methods
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 08:49 EDT by Robert von Massow CLA
Modified: 2017-09-19 18:08 EDT (History)
2 users (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 Robert von Massow CLA 2011-05-16 08:49:37 EDT
Build Identifier: N201105160657

Using the null save operator in a rich string like this:

	 def specialGenCode(CodeBlock block) {
		if(block.inline)
	 		'''\lstinline«block.language?.langSpec»°«block.contents.map([e|e.genCode]).join»°'''

	}

results in the following Java code (just pasing the important part):

StringConcatenation _langSpec = this==null?(StringConcatenation)null:this.langSpec(_language);

Instead of this block.language should be tested for null

Reproducible: Always
Comment 1 Sven Efftinge CLA 2011-05-16 08:56:27 EDT
It's not the rich string context but the use of an extension method which is not working.
Comment 2 Sebastian Zarnekow CLA 2011-08-23 13:01:22 EDT
IIRC this one was already fixed. Please reopen if the problem persists.
Comment 3 Karsten Thoms CLA 2017-09-19 17:57:44 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 18:08:33 EDT
Closing all bugs that were set to RESOLVED before Neon.0