summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeof/type_mismatch.rs
blob: 3f8339fa5beaf91d90d3f75824699c9b1d88dcc4 (plain)
1
2
3
4
5
6
7
8
9
// Test that using typeof results in the correct type mismatch errors instead of always assuming
// `usize`, in addition to the pre-existing "typeof is reserved and unimplemented" error
fn main() {
    const a: u8 = 1;
    let b: typeof(a) = 1i8;
    //~^ ERROR `typeof` is a reserved keyword but unimplemented
    //~| ERROR mismatched types
    //~| expected `u8`, found `i8`
}