Skip to content

Commit

Permalink
Fixing bugs introduced while porting.
Browse files Browse the repository at this point in the history
ArrayClass is magical. Several methods had recursive implementation. PatternMatching was shadowing parameter.
  • Loading branch information
DarkDimius committed Nov 20, 2014
1 parent 6783bec commit de1efa9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Expand Up @@ -276,14 +276,15 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
tree match {
case lblDf @ LabelDef(_, _, _) => genLabelDef(lblDf.asInstanceOf[LabelDef], expectedType)

case ValDef(_, nme_THIS, _, _) =>
case ValDef(_, `nme_THIS`, _, _) =>
debuglog("skipping trivial assign to _$this: " + tree)

case ValDef(_, _, _, rhs) =>
val sym = tree.symbol
/* most of the time, !locals.contains(sym), unless the current activation of genLoad() is being called
while duplicating a finalizer that contains this ValDef. */
val Local(tk, _, idx, isSynth) = locals.getOrMakeLocal(sym)
val loc = locals.getOrMakeLocal(sym)
val Local(tk, _, idx, isSynth) = loc
if (rhs == EmptyTree) { emitZeroOf(tk) }
else { genLoad(rhs, tk) }
val localVarStart = currProgramPoint()
Expand Down
Expand Up @@ -670,7 +670,7 @@ trait BackendInterfaceDefinitions { self: BackendInterface =>
val Object_isInstanceOf: Symbol
val Object_asInstanceOf: Symbol
val Object_equals: Symbol

val ArrayClass: Symbol

val UnitClass: Symbol
val BooleanClass: Symbol
Expand Down Expand Up @@ -709,7 +709,7 @@ trait BackendInterfaceDefinitions { self: BackendInterface =>
val JavaSerializableClass: Symbol = requiredClass[java.io.Serializable]
val SerializableClass: Symbol = requiredClass[scala.Serializable]
val ClassCastExceptionClass: Symbol = requiredClass[java.lang.ClassCastException]
val ArrayClass: Symbol = requiredClass[scala.Array[_]]

val ClassfileAnnotationClass: Symbol = requiredClass[scala.annotation.ClassfileAnnotation]
val BoxedNumberClass: Symbol = requiredClass[java.lang.Number]
val RemoteExceptionClass: Symbol = requiredClass[java.rmi.RemoteException]
Expand Down
Expand Up @@ -127,6 +127,8 @@ class ScalacBackendInterface[G <: Global](val global: G) extends BackendInterfac
val FloatClass: Symbol = global.definitions.FloatClass
val DoubleClass: Symbol = global.definitions.DoubleClass


val ArrayClass: Symbol = global.definitions.ArrayClass
val NothingClass: Symbol = global.definitions.NothingClass
val NullClass: Symbol = global.definitions.NullClass
val ObjectClass: Symbol = global.definitions.ObjectClass
Expand Down Expand Up @@ -903,7 +905,7 @@ class ScalacBackendInterface[G <: Global](val global: G) extends BackendInterfac
trait ScalacNameHelper extends NameHelper{
val n: Name
import global.AnyNameOps
def offset: Int = n.offset
def offset: Int = n.start

def toTypeName: Name = n.toTypeName

Expand All @@ -913,7 +915,7 @@ class ScalacBackendInterface[G <: Global](val global: G) extends BackendInterfac

def dropModule: Name = AnyNameOps(n).dropModule

def len: Int = n.len
def len: Int = n.length

def isTermName: Boolean = n.isTermName

Expand Down

1 comment on commit de1efa9

@scala-jenkins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Job pr-scala failed for de1efa9 Took 50 min. (ping @DarkDimius) (results):


To retry exactly this commit, comment PLS REBUILD/pr-scala@de1efa9f111242bd0d837880bd3cc54345fb4ace on PR 4136.
NOTE: New commits are rebuilt automatically as they appear. A forced rebuild is only necessary for transient failures.

Please sign in to comment.