metaborg / nabl

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

Unification on AST terms looses indices #100

Open AZWN opened 2 years ago

AZWN commented 2 years ago

Bug description When an AST term is bound to a unification variable, it looses its term index.

Versions Spoofax version: 2.5.16, nightly april 2022.

Steps to reproduce the behavior Use a constraint as follows

typeOfExp(s, arg) = T :- {ref id}
  arg == Var2Exp(ref),
  astId(ref, id),
  try { false } | note $[Term index: [id]].

Observed behavior id is a free variable.

Expected behavior id is bound to a particular term index.

Additional context Originally found by @toinehartman