aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_intCast_builtin.zig
blob: 835ba483799a9acf7791ae6b2aec154f05e9aab7 (plain)
1
2
3
4
5
6
7
8
test "integer cast panic" {
    var a: u16 = 0xabcd; // runtime-known
    _ = &a;
    const b: u8 = @intCast(a);
    _ = b;
}

// test_error=integer does not fit in destination type