Skip to content

Conversation

@PhoenixWhitefire
Copy link
Contributor

@PhoenixWhitefire PhoenixWhitefire commented Dec 8, 2025

Additionally adds the LuauReadWriteOnlyIndexers and LuauLValueCompoundAssignmentVisitLhs flag and 6 new tests

The tests are casting string indexing to :: string explicitly because there seems to be an unrelated bug where string singletons are not checked properly

Defined in RFC https://rfcs.luau.org/syntax-property-access-modifiers.html, https://rfcs.luau.org/property-writeonly.html, https://rfcs.luau.org/property-readonly.html

The LuauLValueCompoundAssignmentVisitLhs was added to prevent a merge conflict with #2071, which implements the same fix.

-- These now work:
type T = { read number }
type U = { write [vector]: string }

@PhoenixWhitefire PhoenixWhitefire marked this pull request as draft December 8, 2025 19:08
@PhoenixWhitefire
Copy link
Contributor Author

PhoenixWhitefire commented Dec 8, 2025

Not finished yet:

--!strict

function _foo(x: { read number })
	local y: { number } = x
	y[1] = 5 -- No Type Error
end

EDIT: Fixed, and improved error messages

PhoenixWhitefire and others added 2 commits December 9, 2025 14:00
I need to fix this bug in 2 different PRs, so I'm flagging it with a non-PR-specific name
@PhoenixWhitefire PhoenixWhitefire marked this pull request as draft January 16, 2026 16:53
@PhoenixWhitefire PhoenixWhitefire marked this pull request as ready for review January 17, 2026 06:57
Copy link
Contributor Author

@PhoenixWhitefire PhoenixWhitefire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@PhoenixWhitefire PhoenixWhitefire marked this pull request as draft January 18, 2026 04:44
@PhoenixWhitefire
Copy link
Contributor Author

Need to support different read/write indexers

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.

1 participant