Skip to content

Commit 40cba31

Browse files
authored
Fix type signatures on custom commands (#1598)
1 parent d1926e1 commit 40cba31

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lang-guide/chapters/types/type_signatures.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ There are several syntactic forms that can have type signatures:
1111

1212
- Variable declarations
1313
- Parameter declarations in custom commands and closures
14-
- Input type declarations to custom commands
15-
- Return type declarations from custom commands
14+
- Input and Return type declarations for custom commands
1615

1716
The following code snippets illustrates these kinds of type signatures:
1817

@@ -25,6 +24,16 @@ def my-command [x: int, y: string] { }
2524
2625
# Parameter declaration in closures
2726
do {|nums : list<int>| $nums | describe} [ 1 2 3 ]
27+
28+
# Input and Return type declaration on a custom command
29+
def my-filter []: nothing -> list { }
30+
31+
# Multiple Input/Return type signatures on a custom command
32+
def my-filter []: [
33+
nothing -> list
34+
range -> list
35+
] { }
36+
2837
```
2938

3039
For a further discussion on custom command signatures please refer to: [Custom Commands](/book/custom_commands.html)

0 commit comments

Comments
 (0)