diff options
author | Martin Odersky <odersky@gmail.com> | 2009-12-18 15:20:56 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-12-18 15:20:56 +0000 |
commit | a41d9351d532d5f39a519b4a83740f3592c2a870 (patch) | |
tree | 711b6103331e3b5d211350a551413714abaa33d4 /src/compiler | |
parent | ce4572ca49c2ba0db6b02ffffdece66c4cd3b5e8 (diff) | |
download | scala-a41d9351d532d5f39a519b4a83740f3592c2a870.tar.gz scala-a41d9351d532d5f39a519b4a83740f3592c2a870.tar.bz2 scala-a41d9351d532d5f39a519b4a83740f3592c2a870.zip |
added test case for #2775 and commented the han...
added test case for #2775 and commented the handling code in Implicits
better. Gilles already had a look so noreview.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 707c91e6ad..eea5be32b7 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -771,8 +771,12 @@ self: Analyzer => else if (sym.isTypeParameterOrSkolem) EmptyTree // a manifest should have been found by normal searchImplicit else { - // the following is tricky! We want to find the parameterized version of + // The following is tricky! We want to find the parameterized version of // what will become the erasure of the upper bound. + // But there is a case where the erasure is not a superclass of the current type: + // Any erases to Object. So an abstract type having Any as upper bound will not see + // Object as a baseType. That's why we do the basetype trick only when we must, + // i.e. when the baseclass is parameterized. var era = erasure.erasure(tp1) if (era.typeSymbol.typeParams.nonEmpty) era = tp1.baseType(era.typeSymbol) |