higherkindness / droste

recursion schemes for cats; to iterate is human, to recurse, divine
Apache License 2.0
388 stars 51 forks source link

Ambiguous implicits when using project syntax #117

Open Voltir opened 5 years ago

Voltir commented 5 years ago

In trying to upgrade from 0.6 to 0.7, I was using _.project in various places to unwrap a single level of a pattern functor - that now fails with errors like:

[error]  found   : x$3.type (with underlying type datum.patterns.data.Data)
[error]  required: ?{def project: ?}
[error] Note that implicit conversions are not applicable because they are ambiguous:
[error]  both method toProjectSyntaxOps in trait ProjectSyntax of type [F[_], T](t: T)(implicit PFT: higherkindness.droste.Project[F,T])higherkindness.droste.syntax.ProjectSyntax.ProjectOps[F,T]
[error]  and method toFoldableProjectSyntaxOps in trait ProjectSyntax of type [F[_], T](t: T)(implicit PFT: higherkindness.droste.Project[F,T], implicit FF: cats.Foldable[F])higherkindness.droste.syntax.ProjectSyntax.ProjectFoldableOps[F,T]
[error]  are possible conversion functions from x$3.type to ?{def project: ?}

Looking at the trait ProjectSyntax, perhaps it could be resolved using the LowPriorityImplicitTrait trick to make one of the implicit take precedence over the other?

justjoheinz commented 3 years ago

Can confirm this on 0.8.0.