update tests

This commit is contained in:
SparkyPotato
2023-01-31 22:07:01 +05:30
committed by Teodor Tanasoaia
parent dcfd5c6f4a
commit a5c2cf94b8

View File

@@ -1624,13 +1624,56 @@ fn assign_to_let() {
}
",
r###"error: invalid left-hand side of assignment
┌─ wgsl:4:10
┌─ wgsl:3:17
3 │ let a = 10;
│ ^ this is an immutable binding
4 │ a = 20;
│ ^ cannot assign to this expression
= note: 'a' is an immutable binding
= note: consider declaring it with `var` instead of `let`
= note: consider declaring 'a' with `var` instead of `let`
"###,
);
check(
"
fn f() {
let a = array(1, 2);
a[0] = 1;
}
",
r###"error: invalid left-hand side of assignment
┌─ wgsl:3:17
3 │ let a = array(1, 2);
│ ^ this is an immutable binding
4 │ a[0] = 1;
│ ^^^^ cannot assign to this expression
= note: consider declaring 'a' with `var` instead of `let`
"###,
);
check(
"
struct S { a: i32 }
fn f() {
let a = S(10);
a.a = 20;
}
",
r###"error: invalid left-hand side of assignment
┌─ wgsl:5:17
5 │ let a = S(10);
│ ^ this is an immutable binding
6 │ a.a = 20;
│ ^^^ cannot assign to this expression
= note: consider declaring 'a' with `var` instead of `let`
"###,
);