aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_unresolved_comptime_value.zig
blob: d6cba957ca99d9a0791de74a532009aab8f43ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
fn max(comptime T: type, a: T, b: T) T {
    return if (a > b) a else b;
}
test "try to pass a runtime type" {
    foo(false);
}
fn foo(condition: bool) void {
    const result = max(if (condition) f32 else u64, 1234, 5678);
    _ = result;
}

// test_error=unable to resolve comptime value