Skip to content

Commit 1bbc604

Browse files
committed
update documentation of recheck about top-level boxes
1 parent 9306894 commit 1bbc604

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@ class CheckCaptures extends Recheck, SymTransformer:
508508
case _: RefTree => true
509509
case _ => false
510510

511-
/** If expected type `pt` is boxed, don't propagate free variables.
511+
/** If expected type `pt` is boxed and the tree is a function or a reference,
512+
* don't propagate free variables.
512513
* Otherwise, if the result type is boxed, simulate an unboxing by
513514
* adding all references in the boxed capture set to the current environment.
514515
*/

0 commit comments

Comments
 (0)