Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324566 - [grammar] no check against conflicting imported meta model aliases
Summary: [grammar] no check against conflicting imported meta model aliases
Status: CLOSED WONTFIX
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 07:33 EDT by Knut Wannheden CLA
Modified: 2010-10-05 04:16 EDT (History)
3 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 Knut Wannheden CLA 2010-09-06 07:33:26 EDT
A grammar as follows doesn't result in any validation errors. Conflicting meta model aliases should not be allowed.


grammar org.xtext.example.mydsl.Three with org.xtext.example.mydsl.Two

import  "http://www.xtext.org/example/mydsl/One" as one
import  "http://www.xtext.org/example/mydsl/Two" as one

generate three "http://www.xtext.org/example/mydsl/Three"

Model:
	greetings+=Greeting*;
Comment 1 Michael Clay CLA 2010-09-09 17:23:00 EDT
fixed in HEAD
Comment 2 Sebastian Zarnekow CLA 2010-09-12 08:27:22 EDT
IIRC this was a feature and not a bug. Please revert the patch. We should discuss whether our motiviation to use the same alias for multiple packages is still valid.
Comment 3 Michael Clay CLA 2010-09-12 13:36:37 EDT
done

(In reply to comment #2)
> IIRC this was a feature and not a bug. Please revert the patch. We should
> discuss whether our motiviation to use the same alias for multiple packages is
> still valid.
Comment 4 Sebastian Zarnekow CLA 2010-09-12 13:40:08 EDT
The idea was to enable users to group several packages by means of the same alias. If the classes from the packages do not have the same name, it is no problem to use the same alias. If we disallow this we should try to simplify the linking implementation of the Xtext grammar as well.
Comment 5 Sven Efftinge CLA 2010-09-13 02:46:32 EDT
I would like to close this as won't fix, because it should be ok, to import multiple ecore models into the same namespace. Why not If there's no naming conflict and in case I use two different ecore models a lot I would like to import them both into the default namespace (i.e. no namespace).
Comment 6 Knut Wannheden CLA 2010-09-13 03:52:18 EDT
Obviously I didn't read the documentation carefully enough, where this feature is described!

I can see that someone would want to import multiple packages into the default namespace, but I don't think I've ever seen anyone associating multiple packages with the same alias. And IMHO this should be discouraged.
Comment 7 Sven Efftinge CLA 2010-09-13 04:00:34 EDT
Did it surprise you anyhow or caused trouble?
Comment 8 Sebastian Zarnekow CLA 2010-09-13 04:03:39 EDT
I totally agree. 
Please reopen if we missed anything.
Comment 9 Sebastian Zarnekow CLA 2010-09-13 04:05:07 EDT
Sorry, I missed both last comments :-(
Comment 10 Knut Wannheden CLA 2010-09-13 04:06:25 EDT
Closing as WONTFIX is fine by me. The only thing that surprised me was that it was possible :-)
Comment 11 Sebastian Zarnekow CLA 2010-10-05 04:16:46 EDT
see comment #10