Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants