aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/14854.zig
blob: 8f01ccb3f4114a4d7e286c9d11212c6a17addd2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const testing = @import("std").testing;
const builtin = @import("builtin");

test {
    try testing.expect(getGeneric(u8, getU8) == 123);
}

fn getU8() callconv(.C) u8 {
    return 123;
}

fn getGeneric(comptime T: type, supplier: fn () callconv(.C) T) T {
    return supplier();
}