From 970d4132b66eb77fa0c3d1d2626a1e377bea6ad4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 19 Jul 2011 13:57:37 +0000 Subject: Refactored infoTransformer functionality from n... Refactored infoTransformer functionality from nsc.transform to reflect.internal.transform. Needed so that we can find Java methods that correspond to Scala methods. Review by extempore. --- src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index bf6e7a91ba..8e1ee97387 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -37,7 +37,10 @@ import scala.collection.mutable.ListBuffer * * @todo Check whether we always check type parameter bounds. */ -abstract class RefChecks extends InfoTransform { +abstract class RefChecks extends InfoTransform with reflect.internal.transform.RefChecks { + + val global: Global // need to repeat here because otherwise last mixin defines global as + // SymbolTable. If we had DOT this would not be an issue import global._ import definitions._ @@ -51,11 +54,10 @@ abstract class RefChecks extends InfoTransform { new RefCheckTransformer(unit) override def changesBaseClasses = false - def transformInfo(sym: Symbol, tp: Type): Type = - if (sym.isModule && !sym.isStatic) { - sym setFlag (lateMETHOD | STABLE) - NullaryMethodType(tp) - } else tp + override def transformInfo(sym: Symbol, tp: Type): Type = { + if (sym.isModule && !sym.isStatic) sym setFlag (lateMETHOD | STABLE) + super.transformInfo(sym, tp) + } val toJavaRepeatedParam = new TypeMap { def apply(tp: Type) = tp match { -- cgit v1.2.3