Skip to content

[FEATURE] final keyword #6

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

Open
wants to merge 1 commit into
base: funkin-dev
Choose a base branch
from

Conversation

KoloInDaCrib
Copy link

@KoloInDaCrib KoloInDaCrib commented Feb 20, 2025

Essentially just var but you can only set them if they have a value that equals to null

Works in pair with larsiusprime/polymod#193

Copy link

@AbnormalPoof AbnormalPoof left a comment

Choose a reason for hiding this comment

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

LGTM. If this could also prevent final variables like Constants from being modified (FunkinCrew/Funkin#2474) then that would be great!

@KoloInDaCrib
Copy link
Author

LGTM. If this could also prevent final variables like Constants from being modified (FunkinCrew/Funkin#2474) then that would be great!

I don't even think there is a way to differentiate between a final and a var on runtime. Reflect.setProperty, which is used internally to set the value of a field, ignores both the accessors (i.e. never, null and similar) and finals

@KoloInDaCrib KoloInDaCrib marked this pull request as draft March 28, 2025 06:46
@KoloInDaCrib KoloInDaCrib marked this pull request as ready for review March 28, 2025 14:30
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