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

Bug 363196

Summary: Problem with compatible feature type when redefining variable declaration from xbase
Product: [Modeling] TMF Reporter: Goran <ivan2007>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: christian.dietrich.opensource, kai, sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: juno+
Target Milestone: M4   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Goran CLA 2011-11-08 11:36:40 EST
Build Identifier: I20110613-1736

The following error message is shown when redefining the syntax of variable declarations from Xbase:

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'. The expected type is 'JvmTypeReference'.

See forum : http://www.eclipse.org/forums/index.php/t/261672/

It happens when using the following grammar:


grammar org.xtext.example.mydsl2.MyDsl with org.eclipse.xtext.xbase.annotations.XbaseWithAnnotations

generate myDsl "http://www.xtext.org/example/mydsl2/MyDsl"

import "http://www.eclipse.org/xtext/xbase/Xbase"
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes
import "http://www.eclipse.org/emf/2002/Ecore" as ecore

Model:
	greetings+=Greeting*;
	
Greeting:
	'Hello' name=ID '!';

JavaVariableDeclarator  returns XVariableDeclaration:
	{XVariableDeclaration} writeable?='final'? (type=JvmTypeReference name=ValidID) ('=' right=XExpression)? ';'
;


Reproducible: Always

Steps to Reproduce:
1. Do a fresh eclipse/xtext install 
2. Create a new Xtext project
3. Copy the very short grammar to the mydsl.xtext file.
Comment 1 Sebastian Zarnekow CLA 2011-11-10 06:01:30 EST
Successfully tested with a fresh eclipse and the latest nightly from master and maintenance.
Comment 2 Karsten Thoms CLA 2017-09-19 17:10:56 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:22:36 EDT
Closing all bugs that were set to RESOLVED before Neon.0