From 22e08b7856ffdcd5413da888ac54ca9247e3ccc8 Mon Sep 17 00:00:00 2001 From: Junseo Yoo Date: Mon, 10 Jun 2024 15:13:00 -0700 Subject: [PATCH] Added small bit about syntactic sugar for index type operators --- docs/index-type-operator.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/index-type-operator.md b/docs/index-type-operator.md index 5464591..28e0cc5 100644 --- a/docs/index-type-operator.md +++ b/docs/index-type-operator.md @@ -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 +``` +We could use: +```luau +type name = Person["name"] +``` +or +```luau +type name = Person.name +``` +or even both! \ No newline at end of file