Generic term (de)construction loses attachments. #17
Labels
Prio-Low
Low priority
Project-StrategoXT
Stratego 1 compiler and libraries (from StrategoXT repo)
State-Open
Type-Enhancement
Describe the bug
In the Stratego 2 runtime, generic term (de)construction looses attachments.
Project
We (@Gohla and me) observed the bug when using Stratego 2 as a source dependency. The actual code performing the term manipulation was in a library.
Versions
Eclipse: org.eclipse.platform.ide 4.16.0.I20200604-0540
Spoofax: org.metaborg.spoofax.eclipse 2.6.0.20210820-110929-master
System: Mac OS X x86_64 10.16
To Reproduce
(ATTENTION: untested due to wizard error. See additional context for full explanation.)
foo bar
in this languagefoo
, and execute the builder on itObserved behaviour
For any execution of the builder,
line: 0
is loggedExpected behaviour
Because attachments should be preserved by rewrite rules such as
explode-top
, we expectline: 1
to be logged.Additional context
We originally observed this bug when using the Statix runtime from Stratego 2 in Spoofax 3. Due to the missing attachments, no message locations were available, leading to poor error reporting. We observed that the term that was passed to the Statix solver from the Stratego runtime already lost its attachments. We worked around the issue by wrapping the explosion strategy in
origin-track-forced
: metaborg/nabl@25bbf77. This led us to think that generic deconstruction is involved.The text was updated successfully, but these errors were encountered: