| author | |
| committer | |
| log | a7cac5fc8ed2d49badc6a07ee2e4e77f4ac6e6ae |
| tree | 04db91090ca45afd02b3f41b5e28e7c946a444e9 |
| parent | 2c4ac44f25743f5b7ae9db6bc570ab71f15fd83b |
| signature |
3 files changed, 30 insertions(+), 13 deletions(-)
test/behavior/generics.zig+6-2| ... | ... | @@ -371,8 +371,12 @@ test "extern function used as generic parameter" { |
| 371 | 371 | const S = struct { |
| 372 | 372 | extern fn usedAsGenericParameterFoo() void; |
| 373 | 373 | extern fn usedAsGenericParameterBar() void; |
| 374 | inline fn usedAsGenericParameterBaz(comptime _: anytype) type { | |
| 375 | return struct {}; | |
| 374 | inline fn usedAsGenericParameterBaz(comptime token: anytype) type { | |
| 375 | return struct { | |
| 376 | comptime { | |
| 377 | _ = token; | |
| 378 | } | |
| 379 | }; | |
| 376 | 380 | } |
| 377 | 381 | }; |
| 378 | 382 | try expect(S.usedAsGenericParameterBaz(S.usedAsGenericParameterFoo) != |
test/behavior/src.zig+6-2| ... | ... | @@ -23,8 +23,12 @@ test "@src" { |
| 23 | 23 | |
| 24 | 24 | test "@src used as a comptime parameter" { |
| 25 | 25 | const S = struct { |
| 26 | fn Foo(comptime _: std.builtin.SourceLocation) type { | |
| 27 | return struct {}; | |
| 26 | fn Foo(comptime src: std.builtin.SourceLocation) type { | |
| 27 | return struct { | |
| 28 | comptime { | |
| 29 | _ = src; | |
| 30 | } | |
| 31 | }; | |
| 28 | 32 | } |
| 29 | 33 | }; |
| 30 | 34 | const T1 = S.Foo(@src()); |
test/behavior/typename.zig+18-9| ... | ... | @@ -164,21 +164,30 @@ test "fn param" { |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | fn TypeFromFn(comptime T: type) type { |
| 167 | _ = T; | |
| 168 | return struct {}; | |
| 167 | return struct { | |
| 168 | comptime { | |
| 169 | _ = T; | |
| 170 | } | |
| 171 | }; | |
| 169 | 172 | } |
| 170 | 173 | |
| 171 | 174 | fn TypeFromFn2(comptime T1: type, comptime T2: type) type { |
| 172 | _ = T1; | |
| 173 | _ = T2; | |
| 174 | return struct {}; | |
| 175 | return struct { | |
| 176 | comptime { | |
| 177 | _ = T1; | |
| 178 | _ = T2; | |
| 179 | } | |
| 180 | }; | |
| 175 | 181 | } |
| 176 | 182 | |
| 177 | 183 | fn TypeFromFnB(comptime T1: type, comptime T2: type, comptime T3: type) type { |
| 178 | _ = T1; | |
| 179 | _ = T2; | |
| 180 | _ = T3; | |
| 181 | return struct {}; | |
| 184 | return struct { | |
| 185 | comptime { | |
| 186 | _ = T1; | |
| 187 | _ = T2; | |
| 188 | _ = T3; | |
| 189 | } | |
| 190 | }; | |
| 182 | 191 | } |
| 183 | 192 | |
| 184 | 193 | /// Replaces integers in `actual` with '0' before doing the test. |