diff options
author | Paul Phillips <paulp@improving.org> | 2011-02-14 00:20:51 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-02-14 00:20:51 +0000 |
commit | 4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3 (patch) | |
tree | aef6a104f06ee39f9ce59c4f9a5e66ebb29ec49b | |
parent | 5c99d896427b603d6dfcd9b24945352a0691cad4 (diff) | |
download | scala-4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3.tar.gz scala-4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3.tar.bz2 scala-4ddfe877b26a8a5dea6b71b50481cdfe88cf72c3.zip |
Removed generation of no-op checkcasts for Object.
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 4 |
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 _ => |