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

Poor diagnostics for signed/unsigned match #2068

Closed
jimblandy opened this issue Sep 20, 2022 · 1 comment
Closed

Poor diagnostics for signed/unsigned match #2068

jimblandy opened this issue Sep 20, 2022 · 1 comment
Labels
kind: diagnostics Error message should be better

Comments

@jimblandy
Copy link
Member

jimblandy commented Sep 20, 2022

This class of error may go away entirely once we have implemented the abstract number types. But just in case:

fn f(u: u32) {
   switch (u) {
     case 1: { return; }
     default: { return; }
   }
}

produces:

error: expected unsigned/signed integer literal, found '1'
  ┌─ switch.wgsl:3:11
  │
3 │      case 1: { return; }
  │           ^ expected unsigned/signed integer literal

Could not parse WGSL

1 is definitely an "unsigned/signed integer literal".

Changing it to case 1u: causes validation to succeed.

@teoxoy
Copy link
Member

teoxoy commented Nov 17, 2022

closing as duplicate of #1996

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: diagnostics Error message should be better
Projects
None yet
Development

No branches or pull requests

2 participants