-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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