Closed ivardb closed 5 months ago
@Apanatshka I have gotten a similar error to this one on multiple other names by now as well such as InitialValues, Attributes and a few more. It might be related to how many dynamic rules are being used as I am getting this error on more and more names while not having this problem earlier in the project at all
The bug persists in 0.16.17 once all type errors are fixed as can be seen in this commit. Occasionaly the error does not occur. If this happens just rename one of the dynamic rules in explicate-control and it will most likely occur again: https://gitlab.ewi.tudelft.nl/CS4200/2021-2022/student-icdebruin/-/commit/442fc8b9a6d7a32b0ec2fd416ef5ef8abc701de6
I can reproduce this issue with that last commit you linked to. I'm working on it.
@ivardb there might not be another release of Spoofax 3 before the end of the course, so you might not be able to use the fix I just developed for this issue. Now that I know what the problem is, I can give you a workaround though. Only define a single dynamic rule per strategy. So if you have multiple dynamic rule definitions in a single strategy (or spread over multiple definitions of a single strategy), split it up with a helper:
strategies
// triggers the bug:
foo: a -> a
with rules(LocalVarOffset: () -> a)
with rules(Load: () -> a)
// doesn't trigger the bug:
bar: a -> a
with rules(LocalVarOffset: () -> a)
with bar-helper(|a)
bar-helper(|a) = rules(Load: () -> a)
Describe the bug During the build the following error occurs:
However no errors in the files occur outside of generated files
Project Stratego 2 project
Versions Spoofax: 0.16.15
To Reproduce With bug: https://gitlab.ewi.tudelft.nl/CS4200/2021-2022/student-icdebruin/-/commit/0c90bf5cde91b5fceab1ae64040829400be92171
Fixed: (Change from strategies to rules is not necessary) https://gitlab.ewi.tudelft.nl/CS4200/2021-2022/student-icdebruin/-/commit/06cbad8c7dad644e94986e5ba3d287933ac91044
Observed behaviour Two bugs have been found:
Expected behaviour Either a good error in the file itself or better no error as having Class anywhere in a name cause a problem seem not intended
Additional context No changes to the dynamic rules mentioned in the actual error were made to fix the problem