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

Bug 345934

Summary: [Xtend/Xbase] Null save operator does not work correctly with extension methods
Product: [Modeling] TMF Reporter: Robert von Massow <rvonmassow>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: 2.0.0Flags: sven.efftinge: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Linux   
Whiteboard:

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