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
It seems that the common keyword definitions in a data declaration disappear somewhere. In the following example fillcolor is the culprit.The following code:
Passes the type checker
Is compiled. Note: in the generated companion function fillColor is missing.
During execution the index of fillColor cannot be found.
Any ideas @Anastassija or @mahills: is the typechcker creating these data and is the backend not using them or does the typechecker not generate it.
module experiments::Compiler::Examples::Tst
data Figure (str fillColor = "white") = emptyFigure();
public value main(list[value] args) = emptyFigure().fillColor == "white";
gives
|rascal://experiments::Compiler::RVM::Run|(217,618,<12,0>,<22,28>): Java("RuntimeException","PANIC: (instruction execution): instruction: CALLPRIM adt_field_access, 2; message: null",Java("UndeclaredFieldException","tuple[] does not have a field with label fillColor declared for it"))
The text was updated successfully, but these errors were encountered:
Inside the checker the common keyword parameters are merged over into the constructor-specific parameters, so they should be in with that information. There is also a map, kept off to the side, that maps from IDs (in this case, of the constructor) to names to expressions, which are the defining expressions for the defaults. It sounds like @Anastassija checked and all the checker info is there, but if anything is missing just let me know.
It seems that the common keyword definitions in a data declaration disappear somewhere. In the following example
fillcolor
is the culprit.The following code:companion
functionfillColor
is missing.Any ideas @Anastassija or @mahills: is the typechcker creating these data and is the backend not using them or does the typechecker not generate it.
gives
The text was updated successfully, but these errors were encountered: