You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked at this. The problem is that the compiler considers that the implementation of Times[ZZ] misses the Plus methods (Times is a subprotocol of Plus). So if you reorder the Acton source to merge these two extensions everything works:
Whether this is a temporary problem to be fixed (there are some remaining problems with extensions) or not, I will have to ask the live language definition @nordlander.
(More exactly, the problem is in CodeGen.hs, function declCon, where the compiler decides that the witness class has two abstract attributes add and zero and hence does not generate a new function.)
This example should indeed work as expected without modifying the sources. But the example is also a good illustration of the big remaining problem with extensions, which I'm telling myself I must return to shortly. (The small remaining problem is that we can't implicitly declare extensions by simply listing protocol ancestors when a class is defined, but I guess that's easier to live with.)
Acton Version
0.24.1.20250108.8.28.39
Steps to Reproduce and Observed Behavior
I wanted to implement the
Times[ZZ]
protocol to allow multiplication of ZZ.It looks like the generated C code is missing the zQ_TimesD_ZZG_new function?
Expected Behavior
The program compiles and ZZ multiplication works!
The text was updated successfully, but these errors were encountered: