Skip to content

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

@Twizty

Description

@Twizty

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions