@@ -25,6 +25,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
25
25
26
26
private [this ] var pendingSubTypes : mutable.Set [(Type , Type )] = null
27
27
private [this ] var recCount = 0
28
+ private [this ] var monitored = false
28
29
29
30
private [this ] var needsGc = false
30
31
@@ -102,9 +103,11 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
102
103
if (tp2 eq NoType ) return false
103
104
if ((tp2 eq tp1) || (tp2 eq WildcardType )) return true
104
105
try isSubType(tp1, tp2)
105
- finally
106
+ finally {
107
+ monitored = false
106
108
if (Config .checkConstraintsSatisfiable)
107
109
assert(isSatisfiable, constraint.show)
110
+ }
108
111
}
109
112
110
113
private [this ] var approx : ApproxState = NoApprox
@@ -284,6 +287,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
284
287
if (recur(info1.alias, tp2)) return true
285
288
if (tp1.prefix.isStable) return false
286
289
case _ =>
290
+ if (tp1 eq NothingType ) return tp1 == tp2.bottomType
287
291
}
288
292
thirdTry
289
293
case tp1 : TypeParamRef =>
@@ -837,9 +841,8 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
837
841
val savedSuccessCount = successCount
838
842
try {
839
843
recCount = recCount + 1
840
- val result =
841
- if (recCount < Config .LogPendingSubTypesThreshold ) firstTry
842
- else monitoredIsSubType
844
+ if (recCount >= Config .LogPendingSubTypesThreshold ) monitored = true
845
+ val result = if (monitored) monitoredIsSubType else firstTry
843
846
recCount = recCount - 1
844
847
if (! result) state.resetConstraintTo(saved)
845
848
else if (recCount == 0 && needsGc) {
0 commit comments