@rossberg Ah hah, ok. I had seen the "reinterpret as a struct definition" bit, but I had interpreted it differently. Re-reading it now, I think I see what you're getting at.
So to check my understanding: a type definition (type $T (private i32)) would get desugared into something like (type $T (struct private (field i32))) and private.get $T is then desugared into struct.get $T 0, but since you can add private to arbitrary struct definitions, there is never a need to box a (struct $Fs) inside of a (private (ref (struct $Fs))) because you could just as well have a (struct private $Fs). Also I assume one could have an (array private $elem) and similarly for every other heap type. If that's all right, that sounds great; I really like it.
@rossberg Ah hah, ok. I had seen the "reinterpret as a struct definition" bit, but I had interpreted it differently. Re-reading it now, I think I see what you're getting at.
So to check my understanding: a type definition
(type $T (private i32))
would get desugared into something like(type $T (struct private (field i32)))
andprivate.get $T
is then desugared intostruct.get $T 0
, but since you can addprivate
to arbitrarystruct
definitions, there is never a need to box a(struct $Fs)
inside of a(private (ref (struct $Fs)))
because you could just as well have a(struct private $Fs)
. Also I assume one could have an(array private $elem)
and similarly for every other heap type. If that's all right, that sounds great; I really like it.