Skip to content

Commit 47e1ee6

Browse files
committed
Document 'nil' type hint
1 parent 1c6949f commit 47e1ee6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/New Features/Type Hinting.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ There's no effect on performance. This is implemented entirely during the compil
2323
- `function`
2424
- `table`
2525
- `userdata`
26+
- `nil`
2627
- `void` (return type only)
2728

28-
Prefix a `?` to indicate nil-able types, e.g. `?string` indicates that it may be nil or a string.
29+
Prefix a `?` to indicate void-able types, e.g. `?string` indicates that it may be absent, nil, or a string.
2930

3031
You can also use `|` to delimit alternatives, e.g. `string|int` indicates that it may be a string or an int.
3132

32-
Putting all of this together, we could also have e.g. `?string|int` to indicate that it may be nil, a string, or an int.
33+
Putting all of this together, we could also have e.g. `?string|int` to indicate that it may be absent, nil, a string, or an int.
3334

3435
:::info
3536
This is a WIP feature, and it's very difficult to implement in a one-pass compiler. Allow tolerance for missing coverage, and report any bugs.

0 commit comments

Comments
 (0)