File tree Expand file tree Collapse file tree 4 files changed +326
-216
lines changed
compiler/src/dotty/tools/dotc/cc
tests/pos-custom-args/captures Expand file tree Collapse file tree 4 files changed +326
-216
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,6 @@ end CCState
127
127
def ccState (using Context ) =
128
128
Phases .checkCapturesPhase.asInstanceOf [CheckCaptures ].ccState1
129
129
130
- class NoCommonRoot (rs : Symbol * )(using Context ) extends Exception (
131
- i " No common capture root nested in ${rs.mkString(" and " )}"
132
- )
133
-
134
130
extension (tree : Tree )
135
131
136
132
/** Map tree with CaptureRef type to its type,
Original file line number Diff line number Diff line change @@ -185,10 +185,12 @@ sealed abstract class CaptureSet extends Showable:
185
185
186
186
/** A more optimistic version of subCaptures used to choose one of two typing rules
187
187
* for selections and applications. `cs1 mightSubcapture cs2` if `cs2` might account for
188
- * every element currently known to be in `cs1`.
188
+ * every element currently known to be in `cs1`, and the same is not true in reverse
189
+ * when we compare elements of cs2 vs cs1.
189
190
*/
190
191
def mightSubcapture (that : CaptureSet )(using Context ): Boolean =
191
192
elems.forall(that.mightAccountFor)
193
+ && ! that.elems.forall(this .mightAccountFor)
192
194
193
195
/** The subcapturing test.
194
196
* @param frozen if true, no new variables or dependent sets are allowed to
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ object Test:
8
8
var defaultIncompleteHandler : ErrorHandler = ???
9
9
@ uncheckedCaptures
10
10
var incompleteHandler : ErrorHandler = defaultIncompleteHandler
11
- private val x = incompleteHandler.unsafeUnbox
11
+ private val x = incompleteHandler
12
12
val _ : ErrorHandler = x
13
13
val _ = x(1 , " a" )
14
14
You can’t perform that action at this time.
0 commit comments