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
127127def ccState (using Context ) =
128128 Phases .checkCapturesPhase.asInstanceOf [CheckCaptures ].ccState1
129129
130- class NoCommonRoot (rs : Symbol * )(using Context ) extends Exception (
131- i " No common capture root nested in ${rs.mkString(" and " )}"
132- )
133-
134130extension (tree : Tree )
135131
136132 /** 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:
185185
186186 /** A more optimistic version of subCaptures used to choose one of two typing rules
187187 * 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.
189190 */
190191 def mightSubcapture (that : CaptureSet )(using Context ): Boolean =
191192 elems.forall(that.mightAccountFor)
193+ && ! that.elems.forall(this .mightAccountFor)
192194
193195 /** The subcapturing test.
194196 * @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