component-model icon indicating copy to clipboard operation
component-model copied to clipboard

The canonical ABI's type syntax isn't quite compatible with WIT

Open Liamolucko opened this issue 3 years ago • 0 comments

There are a couple cases where the canonical ABI's mangling of function signatures isn't valid according to WIT.md, specifically around optional types (note: I've left off the identifiers in WIT like they are in the canonical ABI):

WIT Canonical ABI
variant {
    foo,
    bar(string),
}
variant {
    foo(_),
    bar(string),
}

result

result<_, _>

result<T>

result<T, _>

I think that either WIT should be made more permissive to accept these cases as well, or the canonical ABI should be changed to match WIT. (Or some combination of the two on a case-by-case basis.)

Liamolucko avatar Aug 14 '22 06:08 Liamolucko