summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/issue-26681.rs
blob: a0a8c86d9495488d6b257e6ffe12d65a539fc6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(associated_type_defaults)]

// This is a partial regression test for #26681, which used to fail to resolve
// `Self` in the assoc. constant, and now fails with a type mismatch because
// `Self::Fv` cannot be assumed to equal `u8` inside the trait.

trait Foo {
    type Bar;
}

impl Foo for u8 {
    type Bar = ();
}

trait Baz {
    type Fv: Foo = u8;
    const C: <Self::Fv as Foo>::Bar = 6665;  //~ error: mismatched types
}

fn main() {}