Skip to content

Commit ee4c68a

Browse files
authored
Remove trace in adaptBoxed (#22791)
The project currently doesn't clean compile with tracing enabled because there is a `return` in a `trace` block in `CheckCaptures.scala`, which is a non-local return when tracing is enabled. ``` [info] compiling 595 Scala sources and 8 Java sources to /localhome/bovel/scala3/compiler/target/scala-3.6.4-RC1/classes ... [warn] -- Warning: /localhome/bovel/scala3/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala:1387:14 [warn] 1387 | return actual [warn] | ^^^^^^^^^^^^^ [warn] |Non local returns are no longer supported; use `boundary` and `boundary.break` in `scala.util` instead [error] No warnings can be incurred under -Werror (or -Xfatal-warnings) [warn] one warning found [error] one error found [error] (scala3-compiler / Compile / compileIncremental) Compilation failed [error] Total time: 26 s, completed Mar 13, 2025, 10:09:01 AM ``` Interestingly, first compiling with `tracingEnabled = false` and then switching to `true` works 🤔
2 parents 451fdcd + 61340ff commit ee4c68a

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

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

-3
Original file line numberDiff line numberDiff line change
@@ -1434,8 +1434,6 @@ class CheckCaptures extends Recheck, SymTransformer:
14341434
case _: WildcardType => return actual
14351435
case _ =>
14361436

1437-
trace(adaptStr, capt, show = true) {
1438-
14391437
// Decompose the actual type into the inner shape type, the capture set and the box status
14401438
val actualShape = if actual.isFromJavaObject then actual else actual.stripCapturing
14411439
val actualIsBoxed = actual.isBoxedCapturing
@@ -1484,7 +1482,6 @@ class CheckCaptures extends Recheck, SymTransformer:
14841482
else adaptedShape
14851483
.capturing(if alwaysConst then CaptureSet(captures.elems) else captures)
14861484
.forceBoxStatus(resultIsBoxed)
1487-
}
14881485
end recur
14891486

14901487
recur(actual, expected, covariant)

0 commit comments

Comments
 (0)