mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-05-04 10:43:48 +01:00
Reworded for better clarity
Co-authored-by: aaron <aweiss@hey.com>
This commit is contained in:
parent
d3b99419a3
commit
fd8f36cd8a
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ type idxType3 = index<Person | Person2, "age"> -- idxType3 = number | string
|
|||
type idxType4 = index<Person | Person2, "alive" | "age"> -- 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, the `__index` metamethod will *only* be invoked if the indexer is not found within the current scope:
|
||||
In the circumstance that the indexee's type is a class or table with an `__index` metamethod, the `__index` metamethod will *only* be invoked if the indexer is not found within the current scope:
|
||||
```luau
|
||||
local exampleClass = { Foo = "eight" }
|
||||
local exampleClass2 = setmetatable({ Foo = 8 }, { __index = exampleClass })
|
||||
|
|
Loading…
Add table
Reference in a new issue