diff options
author | Martin Odersky <odersky@gmail.com> | 2006-05-24 16:23:44 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-05-24 16:23:44 +0000 |
commit | ed292b2b9b22c5a0f729fe691ccc98ad0deb7087 (patch) | |
tree | fc263ac2545b8c95cc10f82ea47d87ff93d7cb96 | |
parent | 0ecead295c2504855e5a434d0d293a8e5c6f940b (diff) | |
download | scala-ed292b2b9b22c5a0f729fe691ccc98ad0deb7087.tar.gz scala-ed292b2b9b22c5a0f729fe691ccc98ad0deb7087.tar.bz2 scala-ed292b2b9b22c5a0f729fe691ccc98ad0deb7087.zip |
fixed classof -- only class typed can be generated
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 0f88b0e96f..ac8f976063 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1016,9 +1016,11 @@ trait Typers requires Analyzer { if (tparams.length == args.length) { val targs = args map (.tpe) checkBounds(tree.pos, tparams, targs, "") - if (fun.symbol == Predef_classOf) + if (fun.symbol == Predef_classOf) { + if (!targs.head.symbol.isClass || targs.head.symbol.isRefinementClass) + error(args.head.pos, "class type required"); Literal(Constant(targs.head)) setPos tree.pos setType ClassClass.tpe - else + } else copy.TypeApply(tree, fun, args) setType restpe.subst(tparams, targs) } else { errorTree(tree, "wrong number of type parameters for "+treeSymTypeMsg(fun)) |