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

Correctness and diagnostic fixes #2233

Merged
merged 5 commits into from
Feb 1, 2023
Merged

Conversation

SparkyPotato
Copy link
Contributor

Also checks for the ; after break, continue, and discard, as per the spec.

The diagnostic for #2209 is a bit weird:

error: type `array<f32, 0f>` is not constructible
  ┌─ wgsl:2:6
  │
2 │     -array<f32, 0f>() = v;
  │      ^^^^^^^^^^^^^^ type is not constructible

But it does point the user to where the problem is and doesn't crash.

The invalid assignment diagnostic is also improved overall:

error: invalid left-hand side of assignment
  ┌─ wgsl:2:9
  │
2 │     let a = array(1, 2);
  │         ^ this is an immutable binding
3 │     a[0] = 2;
  │     ^^^^ cannot assign to this expression
  │
  = note: consider declaring 'a' with `var` instead of `let`

@SparkyPotato SparkyPotato changed the title Fix panic Correctness and diagnostic fixes Jan 31, 2023
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Just need to resolve the conflict.

@teoxoy teoxoy merged commit a5c2cf9 into gfx-rs:master Feb 1, 2023
@SparkyPotato SparkyPotato deleted the fix-panic branch February 1, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants