@@ -340,15 +340,15 @@ parameters, and results. Functions can optionally also be declared as `async`
340
340
functions.
341
341
342
342
``` wit
343
- thunk: func()
343
+ thunk: func() -> ()
344
344
fibonacci: func(n: u32) -> u32
345
- sleep: async func(ms: u64)
345
+ sleep: async func(ms: u64) -> ()
346
346
```
347
347
348
348
Specifically functions have the structure:
349
349
350
350
``` wit
351
- func-item ::= id ':' 'async'? 'func' func-tuple ( '->' func-tuple )?
351
+ func-item ::= id ':' 'async'? 'func' func-tuple '->' func-tuple
352
352
353
353
func-tuple ::= ty
354
354
| '(' func-named-type-list ')'
@@ -481,22 +481,22 @@ by '-'s starts with a `XID_Start` scalar value with a zero Canonical Combining
481
481
Class:
482
482
483
483
``` wit
484
- foo: func(bar: u32)
484
+ foo: func(bar: u32) -> ()
485
485
486
- red-green-blue: func(r: u32, g: u32, b: u32)
486
+ red-green-blue: func(r: u32, g: u32, b: u32) -> ()
487
487
```
488
488
489
489
This form can't name identifiers which have the same name as wit keywords, so
490
490
the second form is the same syntax with the same restrictions as the first, but
491
491
prefixed with '%':
492
492
493
493
``` wit
494
- %foo: func(%bar: u32)
494
+ %foo: func(%bar: u32) -> ()
495
495
496
- %red-green-blue: func(%r: u32, %g: u32, %b: u32)
496
+ %red-green-blue: func(%r: u32, %g: u32, %b: u32) -> ()
497
497
498
498
// This form also supports identifiers that would otherwise be keywords.
499
- %variant: func(%enum: s32)
499
+ %variant: func(%enum: s32) -> ()
500
500
```
501
501
502
502
[ kebab-case ] : https://en.wikipedia.org/wiki/Letter_case#Kebab_case
0 commit comments