@@ -552,10 +552,7 @@ defvaltype ::= bool
552552valtype ::= <typeidx>
553553 | <defvaltype>
554554resourcetype ::= (resource (rep i32) (dtor async? <funcidx> (callback <funcidx>)?)?)
555- functype ::= (func <paramlist> <resultlist>)
556- paramlist ::= (param "<label>" <valtype>)*
557- resultlist ::= (result "<label>" <valtype>)*
558- | (result <valtype>)
555+ functype ::= (func (param "<label>" <valtype>)* (result <valtype>)?)
559556componenttype ::= (component <componentdecl>*)
560557instancetype ::= (instance <instancedecl>*)
561558componentdecl ::= <importdecl>
@@ -690,13 +687,8 @@ The remaining 4 type constructors in `deftype` use `valtype` to describe
690687shared-nothing functions, resources, components, and component instances:
691688
692689The ` func ` type constructor describes a component-level function definition
693- that takes and returns a list of ` valtype ` . In contrast to [ ` core:functype ` ] ,
694- the parameters and results of ` functype ` can have associated names which
695- validation requires to be unique. To improve the ergonomics and performance of
696- the common case of single-value-returning functions, function types may
697- additionally have a single unnamed return type. For this special case, bindings
698- generators are naturally encouraged to return the single value directly without
699- wrapping it in any containing record/object/struct.
690+ that takes a list of uniquely-named ` valtype ` parameters and optionally returns
691+ a ` valtype ` .
700692
701693The ` resource ` type constructor creates a fresh type for each instance of the
702694containing component (with "freshness" and its interaction with general
0 commit comments