File tree 4 files changed +326
-216
lines changed
compiler/src/dotty/tools/dotc/cc
tests/pos-custom-args/captures 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
You can’t perform that action at this time.
0 commit comments