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

Bug 351821

Summary: false failures in grammar file derived from xbase
Product: [Modeling] TMF Reporter: Andreas Muelder <Andreas.Muelder>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mendapara.amit, sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Andreas Muelder CLA 2011-07-12 07:35:23 EDT
Build Identifier: 20110615-0604

When I create a new Grammar derived from Xbase, I get some false error markers. 

For Example:

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.xbase.Xbase

import "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.ecore"
	
XVariableDeclaration returns XExpression:
	{XVariableDeclaration} (writeable?='var' | 'const') (=> (type=JvmTypeReference name=ValidID) | name=ValidID) ('='
	right=XExpression)?;

I can generate this example without errors. But in the editor, I get the following problem marker attached to 'type=JvmTypeReference'

'Cannot find compatible feature type in sealed EClass XVariableDeclaration
   from imported package http://www.eclipse.org/xtext/xbase/Xbase.
   The existing reference 'type' has an incompatible type 'null'.'






Reproducible: Always
Comment 1 Amit Mendapara CLA 2011-08-09 03:26:37 EDT
I have exactly the same issue. Here is my derived grammar:

[code]
JvmFormalParameter returns types::JvmFormalParameter:
	name=ValidID (':' parameterType=JvmTypeReference)?;

XForLoopExpression returns xbase::XForLoopExpression:
	{xbase::XForLoopExpression}
	'for' '(' declaredParam=JvmFormalParameter 'in' forExpression=XExpression ')'
		eachExpression=XExpression;
[/code]

And the error is:

[code]
Cannot find compatible feature declaredParam in sealed EClass XForLoopExpression from imported package http://www.eclipse.org/xtext/xbase/Xbase. The existing reference 'declaredParam' has an incompatible type 'null'.
[/code]

This happens each time I build the project. Then I have to edit the xtext file and error disappears.
Comment 2 Sebastian Zarnekow CLA 2011-08-16 16:58:53 EDT
Should be fixed in latest version in the repo. Please reopen if the problem is still present.
Comment 3 Karsten Thoms CLA 2017-09-19 17:12:54 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:24:24 EDT
Closing all bugs that were set to RESOLVED before Neon.0