summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-02-25 09:56:15 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-02-25 09:56:15 -0800
commit9948776c454f0e65f98b67bb472ac9cbcbc23d28 (patch)
treec2cc775b4aef6206694bb303fc1bb81e864c40d2
parent9a2455aee4cfb09030ff2c2c0e6861326487e474 (diff)
parentde1f74990aa5321a47dd1366a1e283f2ca8a4e6f (diff)
downloadscala-9948776c454f0e65f98b67bb472ac9cbcbc23d28.tar.gz
scala-9948776c454f0e65f98b67bb472ac9cbcbc23d28.tar.bz2
scala-9948776c454f0e65f98b67bb472ac9cbcbc23d28.zip
Merge pull request #2166 from retronym/ticket/7180
SI-7180 Fix regression in implicit scope of HK type alias.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala2
-rw-r--r--test/files/pos/t7180.scala13
2 files changed, 14 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index d1cf9b1904..3bea049c59 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -1015,7 +1015,7 @@ trait Implicits {
args foreach (getParts(_))
}
} else if (sym.isAliasType) {
- getParts(tp.dealias)
+ getParts(tp.normalize) // SI-7180 Normalize needed to expand HK type refs
} else if (sym.isAbstractType) {
getParts(tp.bounds.hi)
}
diff --git a/test/files/pos/t7180.scala b/test/files/pos/t7180.scala
new file mode 100644
index 0000000000..15582f6df3
--- /dev/null
+++ b/test/files/pos/t7180.scala
@@ -0,0 +1,13 @@
+trait Higher[F[_]]
+
+trait Box[A]
+object Box {
+ implicit def HigherBox = new Higher[Box] {}
+}
+
+object Foo {
+ val box = implicitly[Higher[Box]] // compiles fine !!!
+
+ type Bar[A] = Box[A]
+ val bar = implicitly[Higher[Bar]] // <-- this doesn't compile in 2.10.1-RC1, but does in 2.10.0 !!!
+}