Skip to content

Commit ad8a61f

Browse files
authored
fix: multi-value function return documentation (#274)
1 parent e6f7f51 commit ad8a61f

File tree

1 file changed

+2
-2
lines changed
  • component-model/src/design

1 file changed

+2
-2
lines changed

component-model/src/design/wit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,10 @@ add: func(a: u64, b: u64) -> u64;
298298
lookup: func(store: kv-store, key: string) -> option<string>;
299299
```
300300

301-
A function can have multiple return values. In this case the return values must be named, similar to the parameter list. All return values must be populated (in the same way as tuple or record fields).
301+
For multi-value returns from a function, you can use a [tuple](#tuple) or [record](#record).
302302

303303
```wit
304-
get-customers-paged: func(cont: continuation-token) -> (customers: list<customer>, cont: continuation-token);
304+
get-customers-paged: func(cont: continuation-token) -> tuple<list<customer>, continuation-token>;
305305
```
306306

307307
A function can be declared as part of an [interface](#interfaces), or can be declared as an import or export in a [world](#worlds).

0 commit comments

Comments
 (0)