Sema: add source location to coerce result ptr, fix negation error
This commit is contained in:
committed by
Jakub Konka
parent
979910dc38
commit
cc3336c784
@@ -0,0 +1,12 @@
|
||||
export fn entry() void {
|
||||
var a = &b;
|
||||
_ = a;
|
||||
}
|
||||
fn b() callconv(.Inline) void { }
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :2:9: error: variable of type '*const fn() callconv(.Inline) void' must be const or comptime
|
||||
// :2:9: note: function has inline calling convention
|
||||
@@ -8,7 +8,7 @@ export fn entry() void {
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage1
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// tmp.zig:6:15: error: negation of type 'anyerror!u32'
|
||||
// :6:15: error: negation of type 'anyerror!u32'
|
||||
@@ -6,8 +6,7 @@ export fn entry() void {
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage1
|
||||
// backend=stage2
|
||||
// target=native
|
||||
// is_test=1
|
||||
//
|
||||
// tmp.zig:2:15: error: cannot assign to constant
|
||||
// :2:15: error: cannot assign to constant
|
||||
@@ -9,8 +9,7 @@ export fn entry() void {
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage1
|
||||
// backend=stage2
|
||||
// target=native
|
||||
// is_test=1
|
||||
//
|
||||
// tmp.zig:5:10: error: cannot assign to constant
|
||||
// :5:10: error: cannot assign to constant
|
||||
@@ -1,12 +0,0 @@
|
||||
export fn entry() void {
|
||||
var a = b;
|
||||
_ = a;
|
||||
}
|
||||
fn b() callconv(.Inline) void { }
|
||||
|
||||
// error
|
||||
// backend=stage1
|
||||
// target=native
|
||||
//
|
||||
// tmp.zig:2:5: error: functions marked inline must be stored in const or comptime var
|
||||
// tmp.zig:5:1: note: declared here
|
||||
Reference in New Issue
Block a user