Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different rules with the same name should not be allowed #1029

Closed
hanjoosten opened this issue Dec 28, 2019 · 1 comment
Closed

Different rules with the same name should not be allowed #1029

hanjoosten opened this issue Dec 28, 2019 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior component:type checker

Comments

@hanjoosten
Copy link
Member

Consider the following script:

CONTEXT Issue1029

RULE "aap": I[A]

PATTERN Dummy1
  RULE "aap": I[B] 
ENDPATTERN

PATTERN Dummy2
  RULE "aap": I[C] 
ENDPATTERN

ENDCONTEXT

Version of ampersand that was used

Ampersand-v4.0.0 [development:a0be40614*]

What I expected

I expected the script to fail, because it contains different rules with the same name

What happened instead

It succeeded

Steps to reproduce

  1. Just try to compile the above script. This error must have been there for ages.

Screenshot / Video

Context / Source of ampersand script

@Michiel-s
Copy link
Member

Indeed, this is not correct.
When I run ampersand proto above-script.adl
It produces one rule and only one conjunct, in this case the one for I[B]

select distinct "concept0"."B" as src, "concept1"."B" as tgt 
from "B" as "concept0", "B" as "concept1" 
where "concept0"."B" <> "concept1"."B"

@hanjoosten hanjoosten added the bug Indicates an unexpected problem or unintended behavior label Dec 28, 2019
hanjoosten added a commit that referenced this issue Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component:type checker
Projects
None yet
Development

No branches or pull requests

2 participants