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

Additional Incorrect Error When Switching on enum Type Directly #4379

Open
dozn opened this issue Oct 14, 2024 · 0 comments
Open

Additional Incorrect Error When Switching on enum Type Directly #4379

dozn opened this issue Oct 14, 2024 · 0 comments

Comments

@dozn
Copy link

dozn commented Oct 14, 2024

Context

Enum :: enum {
	a,
}
main :: proc() {
	switch Enum {
	case .a:
	}
}

Odin: dev-2024-10:7989d512a
OS: Windows 11 Professional (version: 23H2), build 22631.4317
CPU: AMD Ryzen 7 3700X 8-Core Processor
RAM: 65489 MiB
Backend: LLVM 18.1.8

Expected Behavior

Only one error describing you aren't able to switch directly on a type

Current Behavior

D:/Programming/odin_ols_testing/main.odin(17:2) Error: Unhandled switch case: a Suggestion: Was '#partial switch' wanted? 
D:/Programming/odin_ols_testing/main.odin(17:9) Error: 'Enum' is not an expression but a type
        switch Enum {
               ^~~^
@dozn dozn changed the title Wrong Error When Switching on enum Directly Additional Wrong Error When Switching on enum Type Directly Oct 14, 2024
@dozn dozn changed the title Additional Wrong Error When Switching on enum Type Directly Additional Incorrect Error When Switching on enum Type Directly Oct 14, 2024
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