Skip to content

Comments

fix index-type-operator RFC to align with runtime behavior#161

Open
hardlyardi wants to merge 3 commits intoluau-lang:masterfrom
hardlyardi:edit-rfc-index-type-function
Open

fix index-type-operator RFC to align with runtime behavior#161
hardlyardi wants to merge 3 commits intoluau-lang:masterfrom
hardlyardi:edit-rfc-index-type-function

Conversation

@hardlyardi
Copy link

currently the RFC specifies this behavior:

the __index metamethod will only be invoked if the indexer is not found within the current scope

this will be changed to:

the type should reflect the result of the expression (tableValue & ~nil) | (__indexValue) where ~ is the negation type symbol.

this better represents the actual runtime behavior for metatables

Co-authored-by: Vyacheslav Egorov <WheretIB@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants