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

Restrict values that can be assigned to compile-time variables #13

Open
GearsDatapacks opened this issue Nov 17, 2024 · 0 comments
Open

Comments

@GearsDatapacks
Copy link
Member

At the moment, you can assign any expression to a compile-time variable. This allows for some weird behaviour:

&a = something(1)
something(2)
do_something_with(&a)

Here, &a refers to the return storage of the something function, but since that function has been called since we assigned to it, the value is now different to what it would have been if accessed earlier. The above code doesn't make much sense to be valid, so we should probably disallow it. There are a few such similar example which we need to decide how to handle.

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