diff options
author | Martin Odersky <odersky@gmail.com> | 2010-02-01 17:15:05 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-02-01 17:15:05 +0000 |
commit | 3282ac260cebe12a2d0dcb6bb7c0e479e0e20c6c (patch) | |
tree | 7573e3247a1215dd23c994cc2733c56532e146c8 | |
parent | 490ed74ff8e5c70789cde74646fd6c2b7abbfc21 (diff) | |
download | scala-3282ac260cebe12a2d0dcb6bb7c0e479e0e20c6c.tar.gz scala-3282ac260cebe12a2d0dcb6bb7c0e479e0e20c6c.tar.bz2 scala-3282ac260cebe12a2d0dcb6bb7c0e479e0e20c6c.zip |
suppresses generation of manifests for abstract...
suppresses generation of manifests for abstract type members.
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 7 | ||||
-rw-r--r-- | test/files/pos/manifest1.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t2795.scala | 1 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 14190a323e..f8a32ab0f8 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -797,7 +797,11 @@ self: Analyzer => "classType", tp, (if ((pre eq NoPrefix) || pre.typeSymbol.isStaticOwner) suffix else findSubManifest(pre) :: suffix): _*) - } else if (sym.isAbstractType) { + } else { + EmptyTree +/* the following is dropped because it is dangerous + * + if (sym.isAbstractType) { if (sym.isExistentiallyBound) EmptyTree // todo: change to existential parameter manifest else if (sym.isTypeParameterOrSkolem) @@ -818,6 +822,7 @@ self: Analyzer => } } else { EmptyTree // a manifest should have been found by normal searchImplicit +*/ } case RefinedType(parents, decls) => // refinement is not generated yet diff --git a/test/files/pos/manifest1.scala b/test/files/pos/manifest1.scala index 4d3b3bfa48..8901aa7437 100644 --- a/test/files/pos/manifest1.scala +++ b/test/files/pos/manifest1.scala @@ -13,8 +13,9 @@ object Test { abstract class C { type T = String; val x: T } val c = new C { val x = "abc" } foo(c.x) - abstract class D { type T; val x: T } - val d: D = new D { type T = String; val x = "x" } + abstract class D { type T; implicit val m: Manifest[T]; val x: T } + val stringm = implicitly[Manifest[String]] + val d: D = new D { type T = String; val m = stringm; val x = "x" } + import d.m foo(d.x) - } diff --git a/test/files/pos/t2795.scala b/test/files/pos/t2795.scala index c355a10c54..a4e1b7db83 100644 --- a/test/files/pos/t2795.scala +++ b/test/files/pos/t2795.scala @@ -5,6 +5,7 @@ trait Element[T] { trait Config { type T <: Element[T] + implicit val m: ClassManifest[T] // XXX Following works fine: // type T <: Element[_] } |