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:
495
495
def isProvisional = this .core match
496
496
case core : TypeProxy => ! core.underlying.exists || core.underlying.isProvisional
497
497
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
499
503
myCaptureSet = null
500
504
else
501
505
myCaptureSet = computed
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import config.{Feature, SourceVersion}
7
7
8
8
object ccConfig :
9
9
10
+ /** If enabled, cache capture sets of infos capabilties */
11
+ inline val cacheCaptureSetOfInfo = false
12
+
10
13
/** If enabled, use a special path in recheckClosure for closures
11
14
* to compare the result tpt of the anonymous functon with the expected
12
15
* 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 - -------------------------------------
2
2
10 | 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*}.
7
11
|
8
12
| longer explanation available when compiling with `-explain`
You can’t perform that action at this time.
0 commit comments