Continuing the discussion from Implementing a "true" Functor in Rust:
Is this a compiler bug / issue?
pub trait NestedMonad<'a>
where
Self: Monad<'a, Self::FmapInOut::FmapInOut>,
Self: FunctorSelf<'a>,
Self::FmapInOut: FunctorSelf<'a>,
/* … */
Errors:
Compiling playground v0.0.1 (/playground)
error[E0223]: ambiguous associated type
--> src/main.rs:65:21
|
65 | Self: Monad<'a, Self::FmapInOut::FmapInOut>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: if there were a trait named `Example` with associated type `FmapInOut` implemented for `<Self as FunctorSelf<'a>>::FmapInOut`, you could use the fully-qualified path
|
65 | Self: Monad<'a, <<Self as FunctorSelf<'a>>::FmapInOut as Example>::FmapInOut>,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For more information about this error, try `rustc --explain E0223`.
error: could not compile `playground` (bin "playground") due to previous error
I don't see how Self::FmapInOut::FmapInOut
could be ambigious because Self::FmapInOut
only implements one trait that provides the associated FmapInOut
type.
It requires this to compile:
- Self: Monad<'a, Self::FmapInOut::FmapInOut>,
+ Self: Monad<'a, <Self::FmapInOut as FunctorSelf<'a>>::FmapInOut>,
Maybe this issue is already known? Or am I missing an ambiguity?