diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-12-12 15:10:37 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-12-16 13:15:04 +0100 |
commit | 92dceb1694a4160e6e29ff8eb0b09ced96e4fa46 (patch) | |
tree | fd84e60e170ad1af04a6a72d30a5d369f37d7bc8 /src/dotty/tools/backend/jvm/DottyBackendInterface.scala | |
parent | 81d56b0b2814faf70110e936852f53b43a7e56d3 (diff) | |
download | dotty-92dceb1694a4160e6e29ff8eb0b09ced96e4fa46.tar.gz dotty-92dceb1694a4160e6e29ff8eb0b09ced96e4fa46.tar.bz2 dotty-92dceb1694a4160e6e29ff8eb0b09ced96e4fa46.zip |
Handle Array.clone
Diffstat (limited to 'src/dotty/tools/backend/jvm/DottyBackendInterface.scala')
-rw-r--r-- | src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index 575599034..672e00a5c 100644 --- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -121,7 +121,11 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ val LongClass: Symbol = defn.LongClass val FloatClass: Symbol = defn.FloatClass val DoubleClass: Symbol = defn.DoubleClass - val Array_clone: Symbol = defn.Array_clone + def isArrayClone(tree: Tree) = tree match { + case Select(qual, StdNames.nme.clone_) if qual.tpe.widen.isInstanceOf[JavaArrayType] => true + case _ => false + } + val hashMethodSym: Symbol = NoSymbol // used to dispatch ## on primitives to ScalaRuntime.hash. Should be implemented by a miniphase val externalEqualsNumNum: Symbol = ctx.requiredMethod(BoxesRunTimeClass, nme.equalsNumNum) lazy val externalEqualsNumChar: Symbol = ??? // ctx.requiredMethod(BoxesRunTimeClass, nme.equalsNumChar) // this method is private @@ -152,7 +156,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ def getPrimitive(sym: Symbol): Int = primitives.getPrimitive(sym) - def isPrimitive(sym: Symbol): Boolean = primitives.isPrimitive(sym) + def isPrimitive(fun: Tree): Boolean = primitives.isPrimitive(fun) } implicit val TypeDefTag: ClassTag[TypeDef] = ClassTag[TypeDef](classOf[TypeDef]) implicit val ApplyTag: ClassTag[Apply] = ClassTag[Apply](classOf[Apply]) @@ -434,7 +438,9 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ isPrivate //|| (sym.isPrimaryConstructor && sym.owner.isTopLevelModuleClass) def isFinal: Boolean = sym is Flags.Final - def isStaticMember: Boolean = (sym is Flags.JavaStatic) || (owner is Flags.ImplClass) + def isStaticMember: Boolean = (sym ne NoSymbol) && ((sym is Flags.JavaStatic) || (owner is Flags.ImplClass)) + // guard against no sumbol cause this code is executed to select which call type(static\dynamic) to use to call array.clone + def isBottomClass: Boolean = (sym ne defn.NullClass) && (sym ne defn.NothingClass) def isBridge: Boolean = sym is Flags.Bridge def isArtifact: Boolean = sym is Flags.Artifact |