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

static variables cant be used after initialization #3350

Open
nobel-sh opened this issue Jan 6, 2025 · 0 comments
Open

static variables cant be used after initialization #3350

nobel-sh opened this issue Jan 6, 2025 · 0 comments

Comments

@nobel-sh
Copy link
Contributor

nobel-sh commented Jan 6, 2025

fn foo() -> i32 {
    static BAR: i32 = 0;
    BAR
}

fn main(){}

This code produces the following error in gccrs.

<source>:3:5: error: cannot find value 'VALUE' in this scope [E0425]
    3 |     VALUE
      |     ^~~~~

Godbolt: https://godbolt.org/z/rWajETTG9

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