Skip to content

Re-enable checks for final access.#415

Open
EliteMasterEric wants to merge 12 commits into
experimentalfrom
final-access
Open

Re-enable checks for final access.#415
EliteMasterEric wants to merge 12 commits into
experimentalfrom
final-access

Conversation

@EliteMasterEric

Copy link
Copy Markdown
Member
  • Improve error messages for invalid access to final variables in scripts.
  • Improve handling of properties with null or never setters (Haxe never allows assignment to never, and only allows local assignment to null).
  • Re-enable the code to prevent assignment to final constants from Haxe code. This prevents issues like being able to re-assign values despite them being defined as immutable constants.

@EliteMasterEric EliteMasterEric self-assigned this Jun 10, 2026
@EliteMasterEric

Copy link
Copy Markdown
Member Author

Oh yeah if you're wondering why it's a draft right now it's because it doesn't fucking work

@EliteMasterEric EliteMasterEric marked this pull request as ready for review June 13, 2026 07:19
@EliteMasterEric

EliteMasterEric commented Jun 13, 2026

Copy link
Copy Markdown
Member Author
image

It works now!

I mainly wrote this to help clean up FunkinCrew/Funkin#7238, so we can rewrite the variables to recycle them without the scripts being able to edit them from the outside.

Definitely should get some review from contributors but this should prevent people from accidentally messing with constants when they aren't supposed to.

An aside, this should be good to merge as-is, but in a future PR it might be nice to add functional metadata that, when applied to a class/method/block, skips this check (in a similar manner to @:privateAccess in Haxe source).

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