Skip to main content



      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 18:05 Go to next message
Eclipse UserFriend

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 02:20 Go to previous message
Eclipse UserFriend
Hi,

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.

Alex
Previous Topic:Creating an unvalidated area of text
Next Topic:Error while validation
Goto Forum:
  


Current Time: Tue Jul 01 16:16:42 EDT 2025

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

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

Back to the top