Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351821 - false failures in grammar file derived from xbase
Summary: false failures in grammar file derived from xbase
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-12 07:35 EDT by Andreas Muelder CLA
Modified: 2017-09-19 17:24 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

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