aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/TyperState.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-01-30 17:53:54 +1100
committerMartin Odersky <odersky@gmail.com>2017-02-08 19:35:58 +1100
commitbc06d17ebfd7c8d6003dffe925c3cf9ebca6b1b9 (patch)
treea40ab611b1f005aef68d869914b353ae10441347 /compiler/src/dotty/tools/dotc/core/TyperState.scala
parent269be04ce9f42d57dbc9ceb24afbae1b615e64e4 (diff)
downloaddotty-bc06d17ebfd7c8d6003dffe925c3cf9ebca6b1b9.tar.gz
dotty-bc06d17ebfd7c8d6003dffe925c3cf9ebca6b1b9.tar.bz2
dotty-bc06d17ebfd7c8d6003dffe925c3cf9ebca6b1b9.zip
Print typerstate nesting info as part of constr printing
When printing info about adding to constraints, show the hashes of the typerstate stack, so that we know where constraints are added.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/TyperState.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/TyperState.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TyperState.scala b/compiler/src/dotty/tools/dotc/core/TyperState.scala
index 5c476c1cb..206438d86 100644
--- a/compiler/src/dotty/tools/dotc/core/TyperState.scala
+++ b/compiler/src/dotty/tools/dotc/core/TyperState.scala
@@ -79,6 +79,9 @@ class TyperState(r: Reporter) extends DotClass with Showable {
def tryWithFallback[T](op: => T)(fallback: => T)(implicit ctx: Context): T = unsupported("tryWithFallBack")
override def toText(printer: Printer): Text = "ImmutableTyperState"
+
+ /** A string showing the hashes of all nested mutable typerstates */
+ def hashesStr: String = ""
}
class MutableTyperState(previous: TyperState, r: Reporter, override val isCommittable: Boolean)
@@ -207,4 +210,7 @@ extends TyperState(r) {
}
override def toText(printer: Printer): Text = constraint.toText(printer)
+
+ override def hashesStr: String = hashCode.toString + " -> " + previous.hashesStr
+
}