Skip to content

Relaxing immediate supertype requirements #41

@tlively

Description

@tlively

We currently have this requirement:

A declared supertype of a type with a (descriptor $x) clause must either not have a descriptor clause or have a (descriptor $y) clause, where $y is a declared supertype of $x.

This makes this arrangement invalid (where the sideways arrows are "described by" and the upward arrows are "subtype of"):

B -> y
^    ^
|    z
|    ^
A -> x

The idea behind this requirement is that type validation should not require unbounded search up the supertype chain, but perhaps production implementations already have constant-time subtype checks available at this point?

We could potentially relax this restriction to allow y to be any supertype of x rather than having to be a declared supertype of x.

Maintaining the stricter requirement inhibits some optimization in Binaryen: WebAssembly/binaryen#7743

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions