File tree 2 files changed +8
-5
lines changed
compiler/src/dotty/tools/dotc
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,12 @@ trait ConstraintRunInfo { self: Run =>
12
12
maxSize = size
13
13
maxConstraint = c
14
14
}
15
- def printMaxConstraint ()(using Context ): Unit = {
16
- val printer = if (ctx.settings.YdetailedStats .value) default else typr
17
- if (maxSize > 0 ) printer.println(s " max constraint = ${maxConstraint.nn.show}" )
18
- }
15
+ def printMaxConstraint ()(using Context ): Unit =
16
+ if maxSize > 0 then
17
+ val printer = if ctx.settings.YdetailedStats .value then default else typr
18
+ printer.println(s " max constraint size: $maxSize" )
19
+ try printer.println(s " max constraint = ${maxConstraint.nn.show}" )
20
+ catch case ex : StackOverflowError => printer.println(" max constraint cannot be printed due to stack overflow" )
21
+
19
22
protected def reset (): Unit = maxConstraint = null
20
23
}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ import collection.mutable
55
55
}
56
56
57
57
def maybeMonitored [T ](op : => T )(using Context ): T =
58
- if (ctx.settings.YdetailedStats .value) {
58
+ if (ctx.settings.YdetailedStats .value && hits.nonEmpty ) {
59
59
monitored = true
60
60
try op
61
61
finally {
You can’t perform that action at this time.
0 commit comments