From 37002e9fb650510e16cd038c5d7026bed50060f9 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 2 Jan 2014 16:04:49 +0100 Subject: Some cleanups. --- src/dotty/tools/dotc/core/Scopes.scala | 3 ++- src/dotty/tools/dotc/core/TypeComparer.scala | 2 +- src/dotty/tools/dotc/core/pickling/UnPickler.scala | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools') diff --git a/src/dotty/tools/dotc/core/Scopes.scala b/src/dotty/tools/dotc/core/Scopes.scala index ef1ddc8b3..06f9ea6c1 100644 --- a/src/dotty/tools/dotc/core/Scopes.scala +++ b/src/dotty/tools/dotc/core/Scopes.scala @@ -17,6 +17,7 @@ import Denotations._ import SymDenotations._ import printing.Texts._ import printing.Printer +import util.common._ import SymDenotations.NoDenotation import collection.mutable.ListBuffer @@ -342,7 +343,7 @@ object Scopes { */ def scopeTransform(owner: Symbol)(op: => MutableScope): MutableScope = op - val selectAll: SymDenotation => Boolean = Function.const(true) + val selectAll: SymDenotation => Boolean = alwaysTrue val selectPrivate: SymDenotation => Boolean = d => (d is Flags.Private) val selectNonPrivate: SymDenotation => Boolean = d => !(d is Flags.Private) diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index cc48f0308..0d3bf2e94 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -971,7 +971,7 @@ class ExplainingTypeComparer(initctx: Context) extends TypeComparer(initctx) { } override def isSubType(tp1: Type, tp2: Type) = - traceIndented(s"${show(tp1)} <:< ${show(tp2)} ${tp1.getClass} ${tp2.getClass} ${if (frozenConstraint) "frozen" else ""}") { + traceIndented(s"${show(tp1)} <:< ${show(tp2)}${if (ctx.settings.verbose.value) s" ${tp1.getClass} ${tp2.getClass}" else ""}${if (frozenConstraint) " frozen" else ""}") { super.isSubType(tp1, tp2) } diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index ff142c21f..ba2845bd1 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -14,6 +14,7 @@ import ast.Trees, ast.tpd._, ast.untpd import printing.Texts._ import printing.Printer import io.AbstractFile +import util.common._ import scala.reflect.internal.pickling.PickleFormat._ import Decorators._ import scala.collection.{ mutable, immutable } @@ -318,7 +319,7 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: protected def readTypeName(): TypeName = readName().toTypeName /** Read a symbol */ - protected def readSymbol(): Symbol = readDisambiguatedSymbol(scala.Function.const(true))() + protected def readSymbol(): Symbol = readDisambiguatedSymbol(alwaysTrue)() /** Read a symbol, with possible disambiguation */ protected def readDisambiguatedSymbol(p: Symbol => Boolean)(): Symbol = { -- cgit v1.2.3