summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index eea0835144..707c91e6ad 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -771,11 +771,14 @@ self: Analyzer =>
else if (sym.isTypeParameterOrSkolem)
EmptyTree // a manifest should have been found by normal searchImplicit
else {
- val era = erasure.erasure(tp1)
- val base = tp1.baseType(era.typeSymbol)
+ // the following is tricky! We want to find the parameterized version of
+ // what will become the erasure of the upper bound.
+ var era = erasure.erasure(tp1)
+ if (era.typeSymbol.typeParams.nonEmpty)
+ era = tp1.baseType(era.typeSymbol)
manifestFactoryCall(
"abstractType", tp,
- findSubManifest(pre) :: Literal(sym.name.toString) :: gen.mkClassOf(base) :: (args map findSubManifest): _*)
+ findSubManifest(pre) :: Literal(sym.name.toString) :: gen.mkClassOf(era) :: (args map findSubManifest): _*)
}
} else {
EmptyTree // a manifest should have been found by normal searchImplicit