Skip to content

Commit

Permalink
Scala requires compilation unit to generate fresh symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkDimius committed Nov 20, 2014
1 parent b1d096f commit 9986e7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Expand Up @@ -368,7 +368,8 @@ trait BCodeSkelBuilder extends BCodeHelpers {
* The invoker must make sure inner classes are tracked for the sym's tpe.
*/
def makeLocal(tk: BType, name: String): Symbol = {
val locSym = methSymbol.freshLocal(name, NoPosition, Flag_SYNTHETIC) // setInfo tpe

val locSym = methSymbol.freshLocal(cunit, name, NoPosition, Flag_SYNTHETIC) // setInfo tpe
makeLocal(locSym, tk)
locSym
}
Expand Down
Expand Up @@ -505,7 +505,7 @@ trait BackendInterface extends BackendInterfaceDefinitions{
def serialVUID: Option[Long]


def freshLocal(name: String, pos: Position, flags: Flags): Symbol
def freshLocal(cunit: CompilationUnit, name: String, pos: Position, flags: Flags): Symbol

def getter(clz: Symbol): Symbol
def setter(clz: Symbol): Symbol
Expand Down Expand Up @@ -702,7 +702,7 @@ trait BackendInterfaceDefinitions { self: BackendInterface =>
val BoxedFloatClass: Symbol = requiredClass[java.lang.Float]
val BoxedDoubleClass: Symbol = requiredClass[java.lang.Double]
val StringClass: Symbol = requiredClass[java.lang.String]
val StringBuilderClass: Symbol = requiredClass[java.lang.StringBuilder]
val StringBuilderClass: Symbol = requiredClass[scala.collection.mutable.StringBuilder]
val ThrowableClass: Symbol = requiredClass[java.lang.Throwable]
val JavaCloneableClass: Symbol = requiredClass[java.lang.Cloneable]
val NullPointerExceptionClass: Symbol = requiredClass[java.lang.NullPointerException]
Expand Down
Expand Up @@ -427,10 +427,9 @@ class ScalacBackendInterface[G <: Global](val global: G) extends BackendInterfac
override def boxMethods = currentRun.runDefinitions.boxMethod

// (class, method)
override def unboxMethods = currentRun.runDefinitions.boxMethod
override def unboxMethods = currentRun.runDefinitions.unboxMethod

trait ScalacSymbolHelper extends SymbolHelper {

def sym: Symbol

// names
Expand Down Expand Up @@ -519,7 +518,9 @@ class ScalacBackendInterface[G <: Global](val global: G) extends BackendInterfac
def outputDirectory: AbstractFile = settings.outputDirs outputDirFor enteringFlatten(sym.sourceFile)


def freshLocal(name: String, pos: Position, flags: Flags): Symbol = sym.freshLocal(name, pos, flags)
def freshLocal(cunit: CompilationUnit, name: String, pos: Position, flags: Flags): Symbol = {
sym.newVariable(cunit.freshTermName(name), pos, flags)
}

def setter(clz: Symbol): Symbol = sym.setterIn(clz)

Expand Down

1 comment on commit 9986e7d

@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 9986e7d Took 60 min. (ping @DarkDimius) (results):


To retry exactly this commit, comment PLS REBUILD/pr-scala@9986e7dc426ad69e74b1883a93f2722d1d7e82f9 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.