Skip to content

Commit be1b6a1

Browse files
committed
TyperState#mergeConstraintWith: use the correct context
Previously, the code in the closure passed to `comparing` could have been using the wrong context. I don't think this happened in practice so far because comparingCtx was always equal to ctx but it will matter in the next commit.
1 parent 5ddd670 commit be1b6a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/TyperState.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class TyperState() {
192192

193193
val comparingCtx = ctx.withTyperState(this)
194194

195-
comparing(typeComparer =>
195+
inContext(comparingCtx)(comparing(typeComparer =>
196196
val other = that.constraint
197197
val res = other.domainLambdas.forall(tl =>
198198
// Integrate the type lambdas from `other`
@@ -219,7 +219,7 @@ class TyperState() {
219219
)
220220
)
221221
assert(res || ctx.reporter.errorsReported, i"cannot merge $constraint with $other.")
222-
)(using comparingCtx)
222+
))
223223

224224
for tl <- constraint.domainLambdas do
225225
if constraint.isRemovable(tl) then constraint = constraint.remove(tl)

0 commit comments

Comments
 (0)