diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-19 07:32:19 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-28 15:17:06 -0800 |
commit | dbebcd509e4013ce02655a2687b27d0967b3650e (patch) | |
tree | 5401fea6b1a118dd2e0b10771fb54f94c7fdc8b3 /test | |
parent | 3bf51189f979eb0dd41744ca844fd12dfdaa0dee (diff) | |
download | scala-dbebcd509e4013ce02655a2687b27d0967b3650e.tar.gz scala-dbebcd509e4013ce02655a2687b27d0967b3650e.tar.bz2 scala-dbebcd509e4013ce02655a2687b27d0967b3650e.zip |
SI-6846, regression in type constructor inference.
In 658ba1b4e6 some inference was gained and some was lost.
In this commit we regain what was lost and gain even more.
Dealiasing and widening should be fully handled now, as
illustrated by the test case.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t6846.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/files/pos/t6846.scala b/test/files/pos/t6846.scala new file mode 100644 index 0000000000..009566493f --- /dev/null +++ b/test/files/pos/t6846.scala @@ -0,0 +1,28 @@ +object Test { + class Arb[_] + implicit def foo[M[_], A]: Arb[M[A]] = null + foo: Arb[List[Int]] + type ListInt = List[Int] + foo: Arb[ListInt] +} + +object Test2 { + import scala.collection.immutable.List + + class Carb[_] + implicit def narrow[N, M[_], A](x: Carb[M[A]])(implicit ev: N <:< M[A]): Carb[N] = null + implicit def bar[M[_], A]: Carb[M[A]] = null + + type ListInt = List[Int] + + val x: List[Int] = List(1) + val y: ListInt = List(1) + + type ListSingletonX = x.type + type ListSingletonY = y.type + + bar: Carb[List[Int]] + bar: Carb[ListInt] + bar: Carb[ListSingletonX] + bar: Carb[ListSingletonY] +} |