Closed presenthee closed 3 weeks ago
That should be correct. The two are unrelated: the Ref_type rules specify the typing of reference values, while the snippet from the parser implements the expansion of type short-hands, which has nothing to do with values.
The interpreter code corresponding to the Ref_type rule is the type_of_ref
function in runtime/value.ml. For modularity reasons, its implementation is split up across multiple places; you can grep for type_of_ref' :=
in runtime/* to find them all.
Oh, thanks for the detailed explanation. After looking at the code mentioned above, I found that the problem is in the interpreter backend, where we are replacing the typing relation with the function call. I'll close the issue, thanks!
Hi, I'm currently debugging assertions in the interpreter backend. Val_type rule is now temporarily implemented as a typing function call, and its implementation uses a value to type conversion function in the reference interpreter.
However, there is a mismatch when checking reference types using the above function. In runtime-typing of spec, Ref_type rules are defined as follows:
In the reference interpreter, ref_type is parsed as follows:
I think the first fields of tuples should be NoNull instead of Null except for the NULLREF case for assertions to work well. Is it a minor issue in the parser of the reference interpreter, or are there any parts I'm missing? Thank you.