-
-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Hi,
If I try and use Simulcrum on the following:
@typeclass trait Functor[F[_]] { self =>
def map[A, B](fa: F[A])(f: A => B): F[B]
def widen[A, B >: A](fa: F[A]): F[B] = fa.asInstanceOf[F[B]]
def xyz[A, B](ff: F[A => B])(a: A): F[B]
}
I get a compiler error:
<pastie>:18: error: not found: type A
def widen[A, B >: A](fa: F[A]): F[B] = fa.asInstanceOf[F[B]]
^
<pastie>:15: error: type arguments [C,B] do not conform to method widen's type parameter bounds [A,B >: A]
@typeclass trait Functor[F[_]] { self =>
^
If I rewrite widen not to use a type bound:
@typeclass trait Functor[F[_]] { self =>
def map[A, B](fa: F[A])(f: A => B): F[B]
def widen[A, B](fa: F[A])(implicit ev: A <:< B): F[B] = fa.asInstanceOf[F[B]]
def xyz[A, B](ff: F[A => B])(a: A): F[B]
}
then I don't get any compilation errors.
Am I using Simulcrum incorrectly or is this a bug?
tmccarthy
Metadata
Metadata
Assignees
Labels
No labels