mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-05-04 10:43:48 +01:00
Update docs/index-type-operator.md
Small change: reworded "syntax" to "type arguments" Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com>
This commit is contained in:
parent
0f30ae5e27
commit
477d7911f0
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ type idxType2 = index<Person, "age" | "name"> -- idxType2 = number | string
|
||||||
|
|
||||||
Now, the type of `doSmt()`'s parameter can be defined without declaring a variable `bob`. Additionally, regardless of how the type `Person` grows, `idxType` will always be defined as the union of all the properties.
|
Now, the type of `doSmt()`'s parameter can be defined without declaring a variable `bob`. Additionally, regardless of how the type `Person` grows, `idxType` will always be defined as the union of all the properties.
|
||||||
|
|
||||||
Error messages will be displayed for incorrect syntax. If the given type used to access a property is invalid,
|
Error messages will be displayed for incorrect type arguments. If the given type used to access a property is invalid,
|
||||||
```lua
|
```lua
|
||||||
type age = index<Person, "ager"> -- Error message: Property 'ager' does not exist on type 'Person'.
|
type age = index<Person, "ager"> -- Error message: Property 'ager' does not exist on type 'Person'.
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue