diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 3 | ||||
-rw-r--r-- | src/library/scala/reflect/ClassManifest.scala | 12 | ||||
-rw-r--r-- | src/library/scala/reflect/Manifest.scala | 12 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 34b98a8945..eea0835144 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -725,14 +725,13 @@ self: Analyzer => def manifestFactoryCall(constructor: String, tparg: Type, args: Tree*): Tree = if (args contains EmptyTree) EmptyTree else typedPos(tree.pos.focus) { - util.trace("manif fact ")( Apply( TypeApply( Select(gen.mkAttributedRef(if (full) FullManifestModule else PartialManifestModule), constructor), List(TypeTree(tparg)) ), args.toList - )) + ) } /** Creates a tree representing one of the singleton manifests.*/ diff --git a/src/library/scala/reflect/ClassManifest.scala b/src/library/scala/reflect/ClassManifest.scala index c8637166ee..58f3c89499 100644 --- a/src/library/scala/reflect/ClassManifest.scala +++ b/src/library/scala/reflect/ClassManifest.scala @@ -214,6 +214,18 @@ object ClassManifest { override def toString = prefix.toString+"#"+name+argString } + /** ClassManifest for the abstract type `prefix # name'. `upperBound' is not + * strictly necessary as it could be obtained by reflection. It was + * added so that erasure can be calculated without reflection. + * todo: remove after next boostrap + */ + def abstractType[T](prefix: OptManifest[_], name: String, upperbound: ClassManifest[_], args: OptManifest[_]*): ClassManifest[T] = + new (ClassManifest[T] @serializable) { + def erasure = upperbound.erasure + override val typeArguments = args.toList + override def toString = prefix.toString+"#"+name+argString + } + /** ClassManifest for the intersection type `parents_0 with ... with parents_n'. */ def intersectionType[T](parents: ClassManifest[_]*): ClassManifest[T] = new (ClassManifest[T] @serializable) { diff --git a/src/library/scala/reflect/Manifest.scala b/src/library/scala/reflect/Manifest.scala index 9dba30911d..69842e1193 100644 --- a/src/library/scala/reflect/Manifest.scala +++ b/src/library/scala/reflect/Manifest.scala @@ -225,6 +225,18 @@ object Manifest { override def toString = prefix.toString+"#"+name+argString } + /** Manifest for the abstract type `prefix # name'. `upperBound' is not + * strictly necessary as it could be obtained by reflection. It was + * added so that erasure can be calculated without reflection. + * todo: remove after next bootstrap + */ + def abstractType[T](prefix: Manifest[_], name: String, upperbound: ClassManifest[_], args: Manifest[_]*): Manifest[T] = + new (Manifest[T] @serializable) { + def erasure = upperbound.erasure + override val typeArguments = args.toList + override def toString = prefix.toString+"#"+name+argString + } + /** Manifest for the intersection type `parents_0 with ... with parents_n'. */ def intersectionType[T](parents: Manifest[_]*): Manifest[T] = new (Manifest[T] @serializable) { |