summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-06-15 14:28:23 -0400
committerSimon Ochsenreither <simon@ochsenreither.de>2013-07-17 23:38:28 +0200
commit4d6be05c28c95dcd26922059d773a8bfed6014ef (patch)
tree4cbb711d44ad2b073dd21d03811fdf3d7198b4d0 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parentaeb733147881d8da68d1e520b14112dc826a3977 (diff)
downloadscala-4d6be05c28c95dcd26922059d773a8bfed6014ef.tar.gz
scala-4d6be05c28c95dcd26922059d773a8bfed6014ef.tar.bz2
scala-4d6be05c28c95dcd26922059d773a8bfed6014ef.zip
Make -Ytyper-debug output readable.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 1f8f13ae02..60641d6752 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -267,10 +267,6 @@ trait Contexts { self: Analyzer =>
/** Saved type bounds for type parameters which are narrowed in a GADT. */
var savedTypeBounds: List[(Symbol, Type)] = List()
- /** Indentation level, in columns, for output under -Ytyper-debug */
- var typingIndentLevel: Int = 0
- def typingIndent = " " * typingIndentLevel
-
/** The next enclosing context (potentially `this`) that is owned by a class or method */
def enclClassOrMethod: Context =
if ((owner eq NoSymbol) || (owner.isClass) || (owner.isMethod)) this
@@ -282,6 +278,11 @@ trait Contexts { self: Analyzer =>
/** ...or an Apply. */
def enclosingApply = nextEnclosing(_.tree.isInstanceOf[Apply])
+ def siteString = {
+ def what_s = if (owner.isConstructor) "" else owner.kindString
+ def where_s = if (owner.isClass) "" else "in " + enclClass.owner.decodedName
+ List(what_s, owner.decodedName, where_s) filterNot (_ == "") mkString " "
+ }
//
// Tracking undetermined type parameters for type argument inference.
//
@@ -445,7 +446,6 @@ trait Contexts { self: Analyzer =>
// Fields that are directly propagated
c.variance = variance
c.diagnostic = diagnostic
- c.typingIndentLevel = typingIndentLevel
c.openImplicits = openImplicits
c.contextMode = contextMode // note: ConstructorSuffix, a bit within `mode`, is conditionally overwritten below.
c._reportBuffer = reportBuffer