summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-08-27 14:45:35 +0000
committerMartin Odersky <odersky@gmail.com>2009-08-27 14:45:35 +0000
commita04195e63727872f04ad01900a18f6ca9ec5cf2b (patch)
tree48964da67438a04e802a5c2324f0a02f2d22efb7 /src/compiler/scala/tools/nsc/typechecker/Implicits.scala
parent2c39b8b0839a5dfd48dfd073944f7b176cc63f4b (diff)
downloadscala-a04195e63727872f04ad01900a18f6ca9ec5cf2b.tar.gz
scala-a04195e63727872f04ad01900a18f6ca9ec5cf2b.tar.bz2
scala-a04195e63727872f04ad01900a18f6ca9ec5cf2b.zip
added manifests to most parts of standard libra...
added manifests to most parts of standard library which deal with arrays. One test is temporarily disabled, as it shows a deep problem with multi-dimensional arrays (which was present all along).
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Implicits.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 9d3cccab37..7ebaa27872 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -599,7 +599,7 @@ self: Analyzer =>
* reflect.Manifest for type 'tp'. An EmptyTree is returned if
* no manifest is found. todo: make this instantiate take type params as well?
*/
- def manifestOfType(tp: Type, full: Boolean): Tree = {
+ private def manifestOfType(tp: Type, full: Boolean): Tree = {
/** Creates a tree that calls the factory method called constructor in object reflect.Manifest */
def manifestFactoryCall(constructor: String, args: Tree*): Tree =
@@ -627,25 +627,22 @@ self: Analyzer =>
case ConstantType(value) =>
manifestOfType(tp0.deconst, full)
case TypeRef(pre, sym, args) =>
- if (isValueClass(sym)) {
+ if (isValueClass(sym) || isPhantomClass(sym)) {
typed { atPos(tree.pos.focus) {
Select(gen.mkAttributedRef(FullManifestModule), sym.name.toString)
}}
- }
- else if (sym.isClass) {
+ } else if (sym.isClass) {
val suffix = gen.mkClassOf(tp0) :: (args map findSubManifest)
manifestFactoryCall(
"classType",
(if ((pre eq NoPrefix) || pre.typeSymbol.isStaticOwner) suffix
else findSubManifest(pre) :: suffix): _*)
- }
- else if (sym.isTypeParameterOrSkolem || sym.isExistential) {
- EmptyTree // a manifest should have been found by normal searchImplicit
- }
- else {
+ } else if (sym.isAbstractType && !sym.isTypeParameterOrSkolem && !sym.isExistential) {
manifestFactoryCall(
"abstractType",
findSubManifest(pre) :: Literal(sym.name.toString) :: findManifest(tp0.bounds.hi) :: (args map findSubManifest): _*)
+ } else {
+ EmptyTree // a manifest should have been found by normal searchImplicit
}
case RefinedType(parents, decls) =>
// refinement is not generated yet