File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
compiler/src/dotty/tools/dotc/cc
tests/neg-custom-args/captures Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -495,7 +495,11 @@ object Capabilities:
495495 def isProvisional = this .core match
496496 case core : TypeProxy => ! core.underlying.exists || core.underlying.isProvisional
497497 case _ => false
498- if ! isCaptureChecking || ctx.mode.is(Mode .IgnoreCaptures ) || isProvisional then
498+ if ! ccConfig.cacheCaptureSetOfInfo
499+ || ! isCaptureChecking
500+ || ctx.mode.is(Mode .IgnoreCaptures )
501+ || isProvisional
502+ then
499503 myCaptureSet = null
500504 else
501505 myCaptureSet = computed
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import config.{Feature, SourceVersion}
77
88object ccConfig :
99
10+ /** If enabled, cache capture sets of infos capabilties */
11+ inline val cacheCaptureSetOfInfo = false
12+
1013 /** If enabled, use a special path in recheckClosure for closures
1114 * to compare the result tpt of the anonymous functon with the expected
1215 * result type. This can narrow the scope of error messages.
Original file line number Diff line number Diff line change 1- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches2.scala:10:10 -------------------------------------
1+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches2.scala:10:8 - -------------------------------------
2210 | ps.map((x, y) => compose1(x, y)) // error
3- | ^^^^^^^^^^^^^^^^^^^^^^^
4- | Found: (x$1: (A^? ->{ps*} A^?, A^? ->{ps*} A^?)^?) ->{ps*} A^? ->{ps*} A^?
5- | Required: ((A ->{ps*} A, A ->{ps*} A)) -> A^? ->? A^?
6- | Note that capability ps* is not included in capture set {}.
3+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+ | Found: List[A^? ->{ps*, cap, cap²} A^?]
5+ | Required: List[A ->{ps*} A]
6+ |
7+ | where: cap is a fresh root capability created in method mapCompose when computing deep capture set of A
8+ | cap² is a fresh root capability created in method mapCompose when computing deep capture set of A
9+ |
10+ | Note that capability cap is not included in capture set {ps*}.
711 |
812 | longer explanation available when compiling with `-explain`
You can’t perform that action at this time.
0 commit comments