@@ -264,9 +264,9 @@ trait Trees extends reflect.internal.Trees { self: Global =>
264264// def resetAllAttrs[A<:Tree](x:A): A = { new ResetAttrsTraverser().traverse(x); x }
265265// def resetLocalAttrs[A<:Tree](x:A): A = { new ResetLocalAttrsTraverser().traverse(x); x }
266266
267- def resetAllAttrs [ A <: Tree ] (x : A , leaveAlone : Tree => Boolean = null ): A = new ResetAttrs (false , leaveAlone).transform(x)
268- def resetLocalAttrs [ A <: Tree ] (x : A , leaveAlone : Tree => Boolean = null ): A = new ResetAttrs (true , leaveAlone).transform(x)
269- def resetLocalAttrsKeepLabels [ A <: Tree ] (x : A , leaveAlone : Tree => Boolean = null ): A = new ResetAttrs (true , leaveAlone, true ).transform(x)
267+ def resetAllAttrs (x : Tree , leaveAlone : Tree => Boolean = null ): Tree = new ResetAttrs (false , leaveAlone).transform(x)
268+ def resetLocalAttrs (x : Tree , leaveAlone : Tree => Boolean = null ): Tree = new ResetAttrs (true , leaveAlone).transform(x)
269+ def resetLocalAttrsKeepLabels (x : Tree , leaveAlone : Tree => Boolean = null ): Tree = new ResetAttrs (true , leaveAlone, true ).transform(x)
270270
271271 /** A transformer which resets symbol and tpe fields of all nodes in a given tree,
272272 * with special treatment of:
@@ -351,7 +351,7 @@ trait Trees extends reflect.internal.Trees { self: Global =>
351351 }
352352 }
353353
354- def transform [ T <: Tree ] (x : T ): T = {
354+ def transform (x : Tree ): Tree = {
355355 if (localOnly)
356356 new MarkLocals ().traverse(x)
357357
@@ -361,10 +361,7 @@ trait Trees extends reflect.internal.Trees { self: Global =>
361361 trace(" locals (%d total): %n" .format(orderedLocals.size))(msg)
362362 }
363363
364- val x1 = new Transformer ().transform(x)
365- // The loose invariant is a temporary workaround for SI-5803
366- assert(x.getClass.isInstance(x1) || (x.isInstanceOf [ApplyConstructor ] && x1.isInstanceOf [Apply ]), (x.getClass, x1.getClass))
367- x1.asInstanceOf [T ]
364+ new Transformer ().transform(x)
368365 }
369366 }
370367
0 commit comments