Sema: analyzeInlineCallArg needs a block for the arg and the param
This commit is contained in:
@@ -183,6 +183,30 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const case = ctx.obj("argument causes error ", .{});
|
||||
case.backend = .stage2;
|
||||
|
||||
case.addSourceFile("b.zig",
|
||||
\\pub const ElfDynLib = struct {
|
||||
\\ pub fn lookup(self: *ElfDynLib, comptime T: type) ?T {
|
||||
\\ _ = self;
|
||||
\\ return undefined;
|
||||
\\ }
|
||||
\\};
|
||||
);
|
||||
|
||||
case.addError(
|
||||
\\pub export fn entry() void {
|
||||
\\ var lib: @import("b.zig").ElfDynLib = undefined;
|
||||
\\ _ = lib.lookup(fn () void);
|
||||
\\}
|
||||
, &[_][]const u8{
|
||||
":3:12: error: unable to resolve comptime value",
|
||||
":3:12: note: argument to function being called at comptime must be comptime known",
|
||||
});
|
||||
}
|
||||
|
||||
// TODO test this in stage2, but we won't even try in stage1
|
||||
//ctx.objErrStage1("inline fn calls itself indirectly",
|
||||
// \\export fn foo() void {
|
||||
|
||||
Reference in New Issue
Block a user