Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed redundant `retypedMethod` in `Duplicators`

It was never used since its introduction in 3ee6b36 by @dragos.

Review by @dragos or @axel22 or @paulp.
  • Loading branch information...
commit c0ba5eb196cc3c7174c9278dd4d050513e55b4ce 1 parent a54d86b
@VladUreche VladUreche authored
Showing with 2 additions and 18 deletions.
  1. +2 −18 src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
View
20 src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
@@ -42,9 +42,6 @@ abstract class Duplicators extends Analyzer {
protected def newBodyDuplicator(context: Context) = new BodyDuplicator(context)
- def retypedMethod(context: Context, tree: Tree, oldThis: Symbol, newThis: Symbol): Tree =
- (newBodyDuplicator(context)).retypedMethod(tree.asInstanceOf[DefDef], oldThis, newThis)
-
/** Return the special typer for duplicate method bodies. */
override def newTyper(context: Context): Typer =
newBodyDuplicator(context)
@@ -186,20 +183,6 @@ abstract class Duplicators extends Analyzer {
stats.foreach(invalidate(_, owner))
}
- def retypedMethod(ddef: DefDef, oldThis: Symbol, newThis: Symbol): Tree = {
- oldClassOwner = oldThis
- newClassOwner = newThis
- invalidateAll(ddef.tparams)
- mforeach(ddef.vparamss) { vdef =>
- invalidate(vdef)
- vdef.tpe = null
- }
- ddef.symbol = NoSymbol
- enterSym(context, ddef)
- debuglog("remapping this of " + oldClassOwner + " to " + newClassOwner)
- typed(ddef)
- }
-
private def inspectTpe(tpe: Type) = {
tpe match {
case MethodType(_, res) =>
@@ -401,7 +384,8 @@ abstract class Duplicators extends Analyzer {
tree.symbol = NoSymbol // maybe we can find a more specific member in a subclass of Any (see AnyVal members, like ==)
}
val ntree = castType(tree, pt)
- super.typed(ntree, mode, pt)
+ val res = super.typed(ntree, mode, pt)
+ res
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.