-
Hello, after overviewing the modified spec, still confused in some expected output of the tests. Take the
And in the expected return values of test:
Here's the questions: Q1. The expected return value of Q2. The second invocation of Q3. Continue from Q2. Does it mean that there must be 1 instance for each defined type when no matter how many times the Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Q1: Q2: Similarly, Q3: No, struct and array instances are the runtime representations of heap-allocated structs and arrays. Consequently, each *.new instruction generates a fresh one. |
Beta Was this translation helpful? Give feedback.
Q1:
(array.ref)
is a "pattern" in the test assertion language, it is matched by any array reference. There is no way to talk about specific array addresses on the assertion level, so that's the most specific construct provided. If more concrete checks are needed, they have to be coded up inside a Wasm module.Q2: Similarly,
(array.eq)
is a pattern matched by all references that are subtypes of eqref. This test simply checks that arrays are correctly treated as equality types in assertions. It doesn't imply anything about the identity of the reference. (Reference identity cannot be checked with assertion patterns alone, see Q1.)Q3: No, struct and array instances are the runtime representa…