diff --git a/docs/index-type-operator.md b/docs/index-type-operator.md index a85e24e..dc774a5 100644 --- a/docs/index-type-operator.md +++ b/docs/index-type-operator.md @@ -54,12 +54,12 @@ Now, the type of `doSmt()`'s parameter can be defined without declaring a variab Error messages will be displayed for incorrect type arguments. If the indexer is not a property in the indexee, ```lua -type age = index -- Error message: Property 'ager' does not exist on type 'Person'. +type age = index -- Error message: Property '"ager"' does not exist on type 'Person' ``` If the indexer is not a type, ```lua local key = "age" -type age = index -- Error message: Type 'key' cannot be used as an index type. +type age = index -- Error message: Second argument to index is not a valid index type; Unknown type 'key' ``` Note: these errors will be part of the general type family reduction errors since `index` will be built into the type family system. @@ -73,7 +73,7 @@ type Person2 = { type idxType3 = index -- idxType3 = number | string -- equivalent of `index | index` -type idxType4 = index -- Error message: Property 'alive' does not exist on type 'Person2'. +type idxType4 = index -- Error message: Property '"age" | "alive"' does not exist on type 'Person | Person2' ``` In the circumstance that the indexee is a type class or table with an `__index` metamethod, `index` will *only* invoke `__index` if indexer is not found within the current scope.