-
Notifications
You must be signed in to change notification settings - Fork 527
Open
Labels
Description
From my testing, Lazy does not work if more than a single type parameter is involved. I have only tested two myself.
import shapeless._
object LazyTest {
new FindSimpleFooer[Int].find
new FindLazySimpleFooer[Int].find
new FindFooer[Int].find
new FindLazyFooer[Int].find
}
class FindSimpleFooer[Tpe] {
def find(implicit fooer: SimpleFooer[Tpe]) = fooer
}
class FindLazySimpleFooer[Tpe] {
def find(implicit fooer: Lazy[SimpleFooer[Tpe]]) = fooer
}
class FindFooer[Tpe] {
def find[F <: Foo](implicit fooer: Fooer[Tpe, F]) = fooer
}
class FindLazyFooer[Tpe] {
def find[F <: Foo](implicit fooer: Lazy[Fooer[Tpe, F]]) = fooer
}
trait Foo
case class BarFoo(i: Int) extends Foo
trait SimpleFooer[Tpe] {
def makeFoo(obj: Tpe): Foo
}
object SimpleFooer {
implicit val barFooer: SimpleFooer[Int] = (obj: Int) => BarFoo(obj)
}
trait Fooer[Tpe, FooTpe <: Foo] {
def makeFoo(obj: Tpe): FooTpe
}
object Fooer {
implicit val barFooer: Fooer[Int, BarFoo] = (obj: Int) => BarFoo(obj)
}Reactions are currently unavailable