diff options
author | Martin Odersky <odersky@gmail.com> | 2011-06-30 12:57:53 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-06-30 12:57:53 +0000 |
commit | 30ccdc9da64335f9120bfd9c582c823bc8741ebe (patch) | |
tree | ec0cb732ec1cea456cd80778c41f0dada3493a9d | |
parent | 349a1aade08490d6771e8494a43fe33009a92944 (diff) | |
download | scala-30ccdc9da64335f9120bfd9c582c823bc8741ebe.tar.gz scala-30ccdc9da64335f9120bfd9c582c823bc8741ebe.tar.bz2 scala-30ccdc9da64335f9120bfd9c582c823bc8741ebe.zip |
Small change to doCookJavaInfo, to have it run ...
Small change to doCookJavaInfo, to have it run less often. Some more
changes in comments. Review by moors.
-rw-r--r-- | src/compiler/scala/reflect/internal/Symbols.scala | 11 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/REPL.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 7 |
3 files changed, 12 insertions, 8 deletions
diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala index ff3677c104..ca22c16e76 100644 --- a/src/compiler/scala/reflect/internal/Symbols.scala +++ b/src/compiler/scala/reflect/internal/Symbols.scala @@ -2082,11 +2082,12 @@ trait Symbols /* extends reflect.generic.Symbols*/ { self: SymbolTable => * info for T in Test1 should be >: Nothing <: Test3[_] */ protected def doCookJavaRawInfo() { - // don't require isJavaDefined, since T in the above example does not have that flag - val tpe1 = rawToExistential(info) - // println("cooking type: "+ this +": "+ info +" to "+ tpe1) - if (tpe1 ne info) { - setInfo(tpe1) + if (isJavaDefined || owner.isJavaDefined) { + val tpe1 = rawToExistential(info) + // println("cooking type: "+ this +": "+ info +" to "+ tpe1) + if (tpe1 ne info) { + setInfo(tpe1) + } } } diff --git a/src/compiler/scala/tools/nsc/interactive/REPL.scala b/src/compiler/scala/tools/nsc/interactive/REPL.scala index 2690a6c79b..7545a2f714 100644 --- a/src/compiler/scala/tools/nsc/interactive/REPL.scala +++ b/src/compiler/scala/tools/nsc/interactive/REPL.scala @@ -60,7 +60,7 @@ object REPL { def main(args: Array[String]) { process(args) - exit(if (reporter.hasErrors) 1 else 0) + /*sys.*/exit(if (reporter.hasErrors) 1 else 0)// Don't use sys yet as this has to run on 2.8.2 also. } def loop(action: (String) => Unit) { diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 0d7f1eb5cf..e9540dba0d 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -892,8 +892,11 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { case DefDef(mods, name, tp, vp, tpt, rhs) if sym.isModule && (!clazz.isTrait || clazz.isImplClass) && !sym.hasFlag(BRIDGE) => val attrThis = - if (clazz.isImplClass) gen.mkAttributedIdent(vp.head.head.symbol) - else gen.mkAttributedThis(clazz) + if (clazz.isImplClass) { + gen.mkAttributedIdent(vp.head.head.symbol) + // Martin to Hubert I think this can be replaced by selfRef(tree.pos) + } else + gen.mkAttributedThis(clazz) val rhs1 = mkInnerClassAccessorDoubleChecked(attrThis, rhs) treeCopy.DefDef(stat, mods, name, tp, vp, tpt, typedPos(stat.pos)(rhs1)) case _ => stat |