Skip to content

Commit e3829f5

Browse files
committed
update documentation of recheck about top-level boxes
1 parent 4805007 commit e3829f5

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
@@ -520,7 +520,8 @@ class CheckCaptures extends Recheck, SymTransformer:
520520
case _: RefTree => true
521521
case _ => false
522522

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

0 commit comments

Comments
 (0)