Skip to content
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

there is no way to declare public final fields #30

Open
calavera opened this issue Nov 21, 2010 · 1 comment
Open

there is no way to declare public final fields #30

calavera opened this issue Nov 21, 2010 · 1 comment

Comments

@calavera
Copy link
Contributor

@calavera calavera commented Nov 21, 2010

The compiler always create private fields:

https://github.com/mirah/mirah/blob/master/lib/mirah/jvm/compiler.rb#L593-597

In some cases, constants for instance, public and final fields are useful.

@baroquebobcat
Copy link
Member

@baroquebobcat baroquebobcat commented Sep 22, 2016

Hm. I think since we're emulating Ruby's behavior it might make sense to default fields to protected. We could allow using @syntax to refer to private and public fields that are not constants.

Maybe for that we'd want to make a syntax for declarations in cases where you want to change the visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.