Sema: add source location to coerce result ptr, fix negation error

This commit is contained in:
Veikka Tuominen
2022-06-28 20:50:14 +03:00
committed by Jakub Konka
parent 979910dc38
commit cc3336c784
9 changed files with 62 additions and 34 deletions

View File

@@ -0,0 +1,15 @@
const S = struct {
x: u32,
};
fn reassign(s: S) void {
s = S{.x = 2};
}
export fn entry() void {
reassign(S{.x = 3});
}
// error
// backend=stage2
// target=native
//
// :5:10: error: cannot assign to constant