summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-14 00:20:51 +0000
committerPaul Phillips <paulp@improving.org>2011-02-14 00:20:51 +0000
commit4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3 (patch)
treeaef6a104f06ee39f9ce59c4f9a5e66ebb29ec49b /src
parent5c99d896427b603d6dfcd9b24945352a0691cad4 (diff)
downloadscala-4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3.tar.gz
scala-4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3.tar.bz2
scala-4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3.zip
Removed generation of no-op checkcasts for Object.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index 7c4deb78f4..ecfdfd9bb0 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -1268,7 +1268,9 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid {
case CHECK_CAST(tpe) =>
tpe match {
case REFERENCE(cls) =>
- jcode emitCHECKCAST new JObjectType(javaName(cls))
+ // No need to checkcast for Objects
+ if (cls != ObjectClass)
+ jcode emitCHECKCAST new JObjectType(javaName(cls))
case ARRAY(elem) =>
jcode emitCHECKCAST new JArrayType(javaType(elem))
case _ =>