diff options
Diffstat (limited to 'tests/ui/associated-types/issue-26681.rs')
-rw-r--r-- | tests/ui/associated-types/issue-26681.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/associated-types/issue-26681.rs b/tests/ui/associated-types/issue-26681.rs new file mode 100644 index 000000000..a0a8c86d9 --- /dev/null +++ b/tests/ui/associated-types/issue-26681.rs @@ -0,0 +1,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() {} |