behavior: correct tests after #18816
This commit is contained in:
@@ -371,8 +371,12 @@ test "extern function used as generic parameter" {
|
||||
const S = struct {
|
||||
extern fn usedAsGenericParameterFoo() void;
|
||||
extern fn usedAsGenericParameterBar() void;
|
||||
inline fn usedAsGenericParameterBaz(comptime _: anytype) type {
|
||||
return struct {};
|
||||
inline fn usedAsGenericParameterBaz(comptime token: anytype) type {
|
||||
return struct {
|
||||
comptime {
|
||||
_ = token;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
try expect(S.usedAsGenericParameterBaz(S.usedAsGenericParameterFoo) !=
|
||||
|
||||
@@ -23,8 +23,12 @@ test "@src" {
|
||||
|
||||
test "@src used as a comptime parameter" {
|
||||
const S = struct {
|
||||
fn Foo(comptime _: std.builtin.SourceLocation) type {
|
||||
return struct {};
|
||||
fn Foo(comptime src: std.builtin.SourceLocation) type {
|
||||
return struct {
|
||||
comptime {
|
||||
_ = src;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
const T1 = S.Foo(@src());
|
||||
|
||||
@@ -164,21 +164,30 @@ test "fn param" {
|
||||
}
|
||||
|
||||
fn TypeFromFn(comptime T: type) type {
|
||||
_ = T;
|
||||
return struct {};
|
||||
return struct {
|
||||
comptime {
|
||||
_ = T;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
fn TypeFromFn2(comptime T1: type, comptime T2: type) type {
|
||||
_ = T1;
|
||||
_ = T2;
|
||||
return struct {};
|
||||
return struct {
|
||||
comptime {
|
||||
_ = T1;
|
||||
_ = T2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
fn TypeFromFnB(comptime T1: type, comptime T2: type, comptime T3: type) type {
|
||||
_ = T1;
|
||||
_ = T2;
|
||||
_ = T3;
|
||||
return struct {};
|
||||
return struct {
|
||||
comptime {
|
||||
_ = T1;
|
||||
_ = T2;
|
||||
_ = T3;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// Replaces integers in `actual` with '0' before doing the test.
|
||||
|
||||
Reference in New Issue
Block a user