Skip to content

Commit

Permalink
Revert "Use LooseCaptureRoot checking for checking bounds of applied …
Browse files Browse the repository at this point in the history
…types"

No tests fail if LooseCaptureRoot is disabled again.

This reverts commit b337b08a14ccb2c3a76651da0cd2aec60e8d1595.
  • Loading branch information
odersky committed Oct 1, 2023
1 parent ce1920d commit 0534202
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class CheckCaptures extends Recheck, SymTransformer:
|| sym.isTerm && defn.isFunctionType(sym.info) && pt == AnySelectionProto
if sym.skipConstructor.isLevelOwner && canInstantiate then
val tpw = tp.widen
var tp1 = mapRoots(sym.localRoot.termRef, CaptureRoot.Var(ctx.owner, sym))(tpw)
val tp1 = mapRoots(sym.localRoot.termRef, CaptureRoot.Var(ctx.owner, sym))(tpw)
.showing(i"INST $sym: $tp, ${sym.localRoot} = $result", ccSetup)
if tpw eq tp1 then tp else tp1
else
Expand Down Expand Up @@ -760,8 +760,6 @@ class CheckCaptures extends Recheck, SymTransformer:
capt.println(i"fallBack from $actualWide to $actualInst to match $expected1")
ok = (actualInst ne actualWide)
&& isCompatible(adaptBoxed(actualInst, expected1, tree.srcPos), expected1)
// Useful for debugging:
// if !ok then err.typeMismatch(tree.withType(actualInst), expected1, addenda ++ CaptureSet.levelErrors)
case _ =>
if !ok then
capt.println(i"conforms failed for ${tree}: $actual vs $expected")
Expand Down Expand Up @@ -1233,6 +1231,6 @@ class CheckCaptures extends Recheck, SymTransformer:
case tree: New =>
case tree: TypeTree => checkAppliedTypesIn(tree.withKnownType)
case _ => traverseChildren(t)
checkApplied.traverse(unit)(using ctx.withProperty(LooseRootChecking, Some(())))
checkApplied.traverse(unit)
end CaptureChecker
end CheckCaptures

0 comments on commit 0534202

Please sign in to comment.