gc icon indicating copy to clipboard operation
gc copied to clipboard

Implementation of 3-pronged subtyping

Open rossberg opened this issue 3 years ago • 0 comments

See #310. This contains implementation and tests.

Edit: One thing to note is that for validation purposes, we actually need 4 bottom types for references, an additional internal one being the true bottom that is a common subtype of all hierarchy-specific bottoms:

any    func    extern
 :       :       :
none  nofunc  noextern
    \____|____/
         |
        bot

That is analogous to the bottom value type that we're already using:

i32 i64 f32 f64 v128 (ref _)
   \__\__\___/___/__/
           |
          bot

Without that forth, true bottom, we don't have principal types for "hierarchy-polymorphic" instructions like ref.as_non_null and br_on_null from the func-ref proposal (i.e., forward validation wouldn't work). Unless we add type annotations to those as well.

rossberg avatar Jul 14 '22 21:07 rossberg