viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

Minor validator suggestion #310

Closed bergmanngabor closed 11 years ago

bergmanngabor commented 11 years ago

We should consider adding a warning-level rule to the validator if a regular and a "don't care" variable have the same name (apart from the underscore).

Reasoning: this might very easily be

  1. a typo, or
  2. the result of mistakenly trying to turn a variable into a wildcard (e.g. after removing it as parameter), but missing one occurence

Example:

Company.tradedStock(Corp, _Stock);
find patt1(Lock, Stock, Barrel1, Barrel2);
ujhelyiz commented 11 years ago

Added a simple validator for this issue. Marking as resolved.

@bergmanngabor please check and close if it works as expected.

bergmanngabor commented 11 years ago

I am at 79b8338075e7510499de672b7eb9325ea1651ec9 which is currently the master. The following pattern produces the warning in the Problems View, but there are no problem markers appearing in the editor itself:

pattern bugtriage(sch) = { 
    School(sch);
    School.name(sch,Name);
    School.address(_sch,Name);
}         

The problem seems to be that the marker location "/randomtest/src/a/b/c/stuff.eiq" is not translated to a location inside the .eiq file.

Therefore I consider the issue still unresolved.

ujhelyiz commented 11 years ago

And the good old generated variables have no source representation issue striked again. I only tested with parameter variables where this issue is not present.

Updated the locator code, and also removed a possible warning duplication issue as well.

istvanrath commented 11 years ago

Fixed.