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:
Junseo Yoo 2024-05-31 09:40:59 -07:00 committed by GitHub
parent 0f30ae5e27
commit 477d7911f0
Signed by: DevComp
GPG key ID: B5690EEEBB952194

View file

@ -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'.
``` ```