Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Stopping error "Duplicate Constrct 'foo' in Struct 'bar'" for function that take different
Stopping error "Duplicate Constrct 'foo' in Struct 'bar'" for function that take different [message #674976] Sun, 29 May 2011 22:05 Go to next message
Richard Cookman is currently offline Richard CookmanFriend
Messages: 7
Registered: May 2011
Junior Member

This is my last problem i'm hoping someone may point me in the direction of someone who might have found a solution to this.

My programming language destingushes functions on both the name and the types of the paramaters. So the problems is simple the eclipse text editor reports that there is a problems with functions of the same name in the same sturcture when there actually isn't.

The ideal would be able to append to the name the types of the paramaters as they are found out, this way correct (for my langauge) duplicate functions could be found and the error given. Otherwise I would need some way to supress the error completely and let only the compiler output find error for duplicates.
Re: Stopping error "Duplicate Constrct 'foo' in Struct 'bar'" for function that take diffe [message #675039 is a reply to message #674976] Mon, 30 May 2011 06:20 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member

the workflow for generating the language infrastructure contains JavaValidatorFragmen that by default has a diplicate name check enabled. Simply comment out the line

composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"

or adapt the NamesAreUniqueValidationHelper so that it does not trigger for functions.

My feeling is that adding the parameter types to the name of the function (which you could do via implementing your own IQualifiedNameProvider) is not a good idea. It might make the scoping a bit complicated. My first approach would be to implement my own duplicate name check which takes parameter types into account. You might also have a look at the Xtend2 code. They will have solved the same problem there.


Need training, onsite consulting or any other kind of help for Xtext?
Go visit or send a mail to
Previous Topic:Creating an unvalidated area of text
Next Topic:Error while validation
Goto Forum:

Current Time: Sun Jun 24 05:44:37 GMT 2018

Powered by FUDForum. Page generated in 0.01344 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top