Added small bit about syntactic sugar for index type operators

This commit is contained in:
Junseo Yoo 2024-06-10 15:13:00 -07:00
parent fd8f36cd8a
commit 22e08b7856

View file

@ -119,3 +119,17 @@ Because there are conflicting types for `p` depending on the run time, it is saf
2. If the indexee is an exact table type, fail to reduce and throw an error.
FYI: exact table type indicates that the table has only the properties listed in its type, and inexact table type indicates that the table has at least the properties listed in its type.
Later down the line, we can also consider adding syntactic sugar for this type operator. Instead of doing:
```luau
type name = index<Person, "name">
```
We could use:
```luau
type name = Person["name"]
```
or
```luau
type name = Person.name
```
or even both!