diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-12-20 17:32:04 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-12-20 17:32:04 +0200 |
| commit | 6da070c5ac1707f2f5370e2e26124a3e114e25ea (patch) | |
| tree | 44f8f0a52f0089b644eccf4f3f61f6abdd45fe10 /test/behavior | |
| parent | 6511afcfe090f26345873e7e8db3ae301f8a18a7 (diff) | |
| download | zig-6da070c5ac1707f2f5370e2e26124a3e114e25ea.tar.gz zig-6da070c5ac1707f2f5370e2e26124a3e114e25ea.zip | |
Sema: fix crash with generic function with generic function parameter
Closes #12810
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/call.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/behavior/call.zig b/test/behavior/call.zig index a8d0d40751..4addd93227 100644 --- a/test/behavior/call.zig +++ b/test/behavior/call.zig @@ -369,3 +369,15 @@ test "Enum constructed by @Type passed as generic argument" { try S.foo(@intToEnum(S.E, i), i); } } + +test "generic function with generic function parameter" { + const S = struct { + fn f(comptime a: fn (anytype) anyerror!void, b: anytype) anyerror!void { + try a(b); + } + fn g(a: anytype) anyerror!void { + try expect(a == 123); + } + }; + try S.f(S.g, 123); +} |
