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

Report const declarations with values not known at compile time. #9

Closed
pzipper opened this issue Jun 3, 2023 · 0 comments
Closed
Labels
A-const-eval Area: compile-time evaluation A-sema Area: the semantic analysis phase on the AST B-none Breaks: nothing, updates are internal and/or don't change existing features C-feature-tracking Category: tracking a planned feature which is not yet implemented M-compiler-panic Dealing with a compiler panic/crash P-high Priority: should ship in the earliest possible release

Comments

@pzipper
Copy link
Member

pzipper commented Jun 3, 2023

The following program causes the compiler to crash:

const MyNumber = 42;

const Main = func(): i32 {
    // MyNumber();
};

const MyValue = Main();
//              ^^^^^^ not known at compile time

(functions cannot currently be called at compile time)

Instead, this should report a nice error message stating that the value is not known at compile time.

@pzipper pzipper added A-sema Area: the semantic analysis phase on the AST B-none Breaks: nothing, updates are internal and/or don't change existing features C-feature-tracking Category: tracking a planned feature which is not yet implemented P-high Priority: should ship in the earliest possible release A-const-eval Area: compile-time evaluation M-compiler-panic Dealing with a compiler panic/crash labels Jun 3, 2023
@pzipper pzipper closed this as completed Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: compile-time evaluation A-sema Area: the semantic analysis phase on the AST B-none Breaks: nothing, updates are internal and/or don't change existing features C-feature-tracking Category: tracking a planned feature which is not yet implemented M-compiler-panic Dealing with a compiler panic/crash P-high Priority: should ship in the earliest possible release
Projects
None yet
Development

No branches or pull requests

1 participant