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

Distinguish Constants from Static Variables #107

Open
DavePearce opened this issue Jan 18, 2022 · 0 comments
Open

Distinguish Constants from Static Variables #107

DavePearce opened this issue Jan 18, 2022 · 0 comments

Comments

@DavePearce
Copy link
Member

DavePearce commented Jan 18, 2022

(see also RFC#0008)

Currently, constants are implemented as final statics. However, it may make sense to actually distinguish this. For example, we could have:

constant int x = 1
static int y = 2
final static int z = 3

Its not clear to me what the value of a final static would be. However, the key difference is that constants would not be inlined, and would not be usable in certain contexts. Observe that this distinction follows Rust.

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

No branches or pull requests

1 participant