Steps to reproduce the behavior
See this stxtest file:
resolve
bugged([Test(), Other()])
signature
sorts Test
constructors
Test : Test
Other : Test
rules
bugged : list(Test)
bugged(a@[h|t]) :- {id1 id2 id3}
astId(a, id1),
astId(h, id2),
astId(t, id3),
try { false } | note$[list id: [id1] head id: [id2] tail id: [id3]].
bugged2 : list(Test)
bugged2(a) :- {id}
astId(a, id),
try { false } | note$[list id: [id]].
Observed behavior
The ids for term a and h are both 5. When compared to the output of Show Analyzed AST this appears to be the id corresponding to term h.
The bugged2 rule shows that this issue also occurs when the [h|t] syntax isn't used.
Expected behavior
The id for term a should be the id for the list term, corresponding to what's shown by Show Analyzed AST. Instead of the id of the head term of the list term.
Additional context
This bug makes it impossible to assign properties (@x.prop := y) to list terms, as it'll get assigned to the head term instead.
Bug description
Versions Spoofax version: Spoofax 3 (local branch at https://github.com/RvanBaarle/spoofax-pie/develop), using nabl repository at commit 36b9fad6 Statix setup:
single-file
Steps to reproduce the behavior See this stxtest file:
Observed behavior The ids for term
a
andh
are both 5. When compared to the output of Show Analyzed AST this appears to be the id corresponding to termh
. Thebugged2
rule shows that this issue also occurs when the[h|t]
syntax isn't used.Expected behavior The id for term
a
should be the id for the list term, corresponding to what's shown by Show Analyzed AST. Instead of the id of the head term of the list term.Additional context This bug makes it impossible to assign properties (
@x.prop := y
) to list terms, as it'll get assigned to the head term instead.