Skip to content

Commit 046dff9

Browse files
committed
Revert "Use LooseCaptureRoot checking for checking bounds of applied types"
No tests fail if LooseCaptureRoot is disabled again. This reverts commit b337b08a14ccb2c3a76651da0cd2aec60e8d1595.
1 parent 1f9bf26 commit 046dff9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ class CheckCaptures extends Recheck, SymTransformer:
376376
|| sym.isTerm && defn.isFunctionType(sym.info) && pt == AnySelectionProto
377377
if sym.skipConstructor.isLevelOwner && canInstantiate then
378378
val tpw = tp.widen
379-
var tp1 = mapRoots(sym.localRoot.termRef, CaptureRoot.Var(ctx.owner, sym))(tpw)
379+
val tp1 = mapRoots(sym.localRoot.termRef, CaptureRoot.Var(ctx.owner, sym))(tpw)
380380
.showing(i"INST $sym: $tp, ${sym.localRoot} = $result", ccSetup)
381381
if tpw eq tp1 then tp else tp1
382382
else
@@ -760,8 +760,6 @@ class CheckCaptures extends Recheck, SymTransformer:
760760
capt.println(i"fallBack from $actualWide to $actualInst to match $expected1")
761761
ok = (actualInst ne actualWide)
762762
&& isCompatible(adaptBoxed(actualInst, expected1, tree.srcPos), expected1)
763-
// Useful for debugging:
764-
// if !ok then err.typeMismatch(tree.withType(actualInst), expected1, addenda ++ CaptureSet.levelErrors)
765763
case _ =>
766764
if !ok then
767765
capt.println(i"conforms failed for ${tree}: $actual vs $expected")
@@ -1233,6 +1231,6 @@ class CheckCaptures extends Recheck, SymTransformer:
12331231
case tree: New =>
12341232
case tree: TypeTree => checkAppliedTypesIn(tree.withKnownType)
12351233
case _ => traverseChildren(t)
1236-
checkApplied.traverse(unit)(using ctx.withProperty(LooseRootChecking, Some(())))
1234+
checkApplied.traverse(unit)
12371235
end CaptureChecker
12381236
end CheckCaptures

0 commit comments

Comments
 (0)