metaborg / nabl

Spoofax' Name Binding Language
Apache License 2.0
7 stars 12 forks source link

Invalid errors on Self-imports. #104

Open AZWN opened 2 years ago

AZWN commented 2 years ago

Bug description A direct self-import in a Statix module gives error messages on rule definitions.

Versions 2.5.17

Steps to reproduce the behavior Open the following Statix specification:

module mod

imports mod

rules 
  id:
  id().

Observed behavior Editor error messages:

Unresolved constraint "id"
Unsolved: ?mod.stx-d-2 : ?mod.stx-ty-2
Unsolved: [] is `in-types` of ?mod.stx-ty-2
Unsolved: Rules can only be defined for declared constraints.
Unsolved: Use `c(...) = ... | ...` for functional constraints.

Expected behavior Either (1) no error messages, or (2) an error on the self-import.

Additional context Originally reported by @toinehartman.