-
Hi, there's a question of matching the subtype, and need the explaination for it. As the module in the test of subtyping :
This module should pass the validation.
For the final step matching, follow the rule of matching function type, the That is, the defined type According to the rule of matching defined types, the type |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You probably missed that function subtyping is contravariant in the parameters, i.e., the subtyping rule switches direction for the parameter types (in Wasm's rule, the premise t21* ≤ t11*). Thus, $s' needs to match $s, not the other way round. (Edit: fixed typo) |
Beta Was this translation helpful? Give feedback.
You probably missed that function subtyping is contravariant in the parameters, i.e., the subtyping rule switches direction for the parameter types (in Wasm's rule, the premise t21* ≤ t11*). Thus, $s' needs to match $s, not the other way round. (Edit: fixed typo)