Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type mismatch when generating instances for F[G[_]] #162

Open
Twizty opened this issue Nov 14, 2019 · 0 comments
Open

Type mismatch when generating instances for F[G[_]] #162

Twizty opened this issue Nov 14, 2019 · 0 comments

Comments

@Twizty
Copy link

Twizty commented Nov 14, 2019

Hi, I've been working on the issue at cats (typelevel/cats#3141), and have found strange behavior of simulacrum. I've implemented a method def foldA[G[_], A](fga: F[G[A]])(implicit G: Applicative[G], A: Monoid[A]): G[A] for Foldable and it's compiled to def foldA[G[_], A](implicit ev$macro$49: <:<[D, G[A]], G: Applicative[G], A: Monoid[D]) = typeClassInstance.foldA(self.asInstanceOf[F[G[A]]])(G, A); which fails with this error:

type mismatch;
found   : cats.Monoid[D]
   (which expands to)  cats.kernel.Monoid[D]
required: cats.Monoid[A]
   (which expands to)  cats.kernel.Monoid[A]
@typeclass trait Foldable[F[_]] extends UnorderedFoldable[F] { self =>
^

Is it a bug or am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant