Skip to content

Commit

Permalink
Test to close scala/bug#5075.
Browse files Browse the repository at this point in the history
  • Loading branch information
milessabin authored and adriaanm committed Jun 1, 2018
1 parent f16eacc commit 94e2285
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/files/pos/t5075.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Derived from Scalaz - http://scalaz.googlecode.com/svn/continuous/latest/browse.sxr/scalaz/PartialApplys.scala.html

trait PartialApply1Of2[T[_, _], A] { type Apply[B] = T[A, B] }

trait HKT[D[_]]
trait HKTBounded[C[X] <: Traversable[X], D[_]]
trait Cov[+T]

class Test {
// exercise type constructor inference in different ways
implicit def m[D[_]](t: HKT[D]): Int = 1
def mCov[D[_]](t: Cov[HKT[D]]): Any = ???
def mBounded[C[X] <: Traversable[X], D[_]](t: Cov[HKTBounded[C, D]]): Any = ???

val param: HKT[PartialApply1Of2[Tuple2, Int]#Apply] = ???
m[PartialApply1Of2[Tuple2, Int]#Apply](param): Int // Already compiled
m(param) // Compiles now
param: Int // Compiles now

val paramCov: Cov[HKT[PartialApply1Of2[Tuple2, Int]#Apply]] = ???
mCov[PartialApply1Of2[Tuple2, Int]#Apply](paramCov)
mCov(paramCov)

val paramBounded: Cov[HKTBounded[Traversable, PartialApply1Of2[Tuple2, Int]#Apply]] = ???
mBounded[Traversable, PartialApply1Of2[Tuple2, Int]#Apply](paramBounded)
mBounded(paramBounded)
}

0 comments on commit 94e2285

Please sign in to comment.