-
Notifications
You must be signed in to change notification settings - Fork 496
Read-only/Write-only extern properties, Read-only vector properties
#2071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Read-only/Write-only extern properties, Read-only vector properties
#2071
Conversation
… and make `vector` properties read-only Adds support for `read` and `write` property attributes for extern type declarations The structure is intended to be the same as for table types: declare extern type E as (read/write/<blank>) <property>: T end Modifies the embedded type definition of `vector`s to mark `.x`, `.y` and `.z` as read-only
My mistake!
This is after migrating to the latest version of Luau, the previous changes were actually written on the *prior* release and copied over (imperfectly) but it should all be good now
|
I don't know what any of these means but I think they're pretty cool |
andyfriesen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch!
This all looks fine. We just need you to flag it before we can merge it.
…rReadOnly", Added newline to Makefile
In order to maintain the `LuauTypeCheckerVectorLerp2` flag, I would have to add 2 extra copies of the `vector` library definitions. `vector.lerp` has been out for several months now anyway, the rest of the rollout flags should also probably be removed...
Now, it only affects the fastcall guard
|
The flags |
Implements the
readandwriteproperty attributes for external type definitions, which the embeddedvectortype now makes use of:Before:
After:
The following code now creates type-errors in the expected places:
Additionally,
LuauExternReadWriteAttributesandLuauTypeCheckerVectorReadOnlyflagsLuauTypeCheckerVectorLerp2flag (keeping it would lead to 4 slightly different copies of thevectorlibrary definition)LuauVectorLerpnow only works for the fastcall gate, the VM will alway register the function (doing this felt better than fixing the failing tests -vector.lerpcan't be disabled at this point anyway)Closes #2062