]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/issue-79636-1.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / generic-associated-types / issue-79636-1.rs
1 trait Monad {
2     type Unwrapped;
3     type Wrapped<B>;
4
5     fn bind<B, F>(self, f: F) -> Self::Wrapped<B> {
6         todo!()
7     }
8 }
9
10 fn join<MOuter, MInner, A>(outer: MOuter) -> MOuter::Wrapped<A>
11 where
12     MOuter: Monad<Unwrapped = MInner>,
13     MInner: Monad<Unwrapped = A, Wrapped = MOuter::Wrapped<A>>,
14     //~^ ERROR: missing generics for associated type `Monad::Wrapped`
15 {
16     outer.bind(|inner| inner)
17 }
18
19 fn main() {
20     assert_eq!(join(Some(Some(true))), Some(true));
21 }