@@ -552,10 +552,7 @@ defvaltype ::= bool
552
552
valtype ::= <typeidx>
553
553
| <defvaltype>
554
554
resourcetype ::= (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>)?)
559
556
componenttype ::= (component <componentdecl>*)
560
557
instancetype ::= (instance <instancedecl>*)
561
558
componentdecl ::= <importdecl>
@@ -690,13 +687,8 @@ The remaining 4 type constructors in `deftype` use `valtype` to describe
690
687
shared-nothing functions, resources, components, and component instances:
691
688
692
689
The ` 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 ` .
700
692
701
693
The ` resource ` type constructor creates a fresh type for each instance of the
702
694
containing component (with "freshness" and its interaction with general
0 commit comments