@@ -376,7 +376,7 @@ class CheckCaptures extends Recheck, SymTransformer:
376
376
|| sym.isTerm && defn.isFunctionType(sym.info) && pt == AnySelectionProto
377
377
if sym.skipConstructor.isLevelOwner && canInstantiate then
378
378
val tpw = tp.widen
379
- val tp1 = mapRoots(sym.localRoot.termRef, CaptureRoot .Var (ctx.owner, sym))(tpw)
379
+ var tp1 = mapRoots(sym.localRoot.termRef, CaptureRoot .Var (ctx.owner, sym))(tpw)
380
380
.showing(i " INST $sym: $tp, ${sym.localRoot} = $result" , ccSetup)
381
381
if tpw eq tp1 then tp else tp1
382
382
else
@@ -760,6 +760,8 @@ class CheckCaptures extends Recheck, SymTransformer:
760
760
capt.println(i " fallBack from $actualWide to $actualInst to match $expected1" )
761
761
ok = (actualInst ne actualWide)
762
762
&& isCompatible(adaptBoxed(actualInst, expected1, tree.srcPos), expected1)
763
+ // Useful for debugging:
764
+ // if !ok then err.typeMismatch(tree.withType(actualInst), expected1, addenda ++ CaptureSet.levelErrors)
763
765
case _ =>
764
766
if ! ok then
765
767
capt.println(i " conforms failed for ${tree}: $actual vs $expected" )
@@ -1231,6 +1233,6 @@ class CheckCaptures extends Recheck, SymTransformer:
1231
1233
case tree : New =>
1232
1234
case tree : TypeTree => checkAppliedTypesIn(tree.withKnownType)
1233
1235
case _ => traverseChildren(t)
1234
- checkApplied.traverse(unit)
1236
+ checkApplied.traverse(unit)( using ctx.withProperty( LooseRootChecking , Some (())))
1235
1237
end CaptureChecker
1236
1238
end CheckCaptures
0 commit comments