Skip to content

Commit 5bd8efa

Browse files
committed
Hack: use monotonicity trick only for empty-parameter-list functions
like () ?=> T, () => T
1 parent 2b81ca9 commit 5bd8efa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ class CheckCaptures extends Recheck, SymTransformer:
777777
case appType @ CapturingType(appType1, refs)
778778
if qualType.exists
779779
&& !tree.fun.symbol.isConstructor
780+
&& funType.paramInfos.isEmpty
780781
&& qualCaptures.mightSubcapture(refs)
781782
&& argCaptures.forall(_.mightSubcapture(refs)) =>
782783
val callCaptures = argCaptures.foldLeft(qualCaptures)(_ ++ _)

0 commit comments

Comments
 (0)