File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/cc
tests/pos-custom-args/captures Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1678,7 +1678,8 @@ object CaptureSet:
16781678 else this (acc, parent)
16791679
16801680 def abstractTypeCase (acc : CaptureSet , t : TypeRef , upperBound : Type ) =
1681- if includeTypevars && upperBound.isExactlyAny then fresh(Origin .DeepCS (t))
1681+ if t.derivesFrom(defn.Caps_CapSet ) then t.singletonCaptureSet
1682+ else if includeTypevars && upperBound.isExactlyAny then fresh(Origin .DeepCS (t))
16821683 else this (acc, upperBound)
16831684
16841685 collect(CaptureSet .empty, tp)
Original file line number Diff line number Diff line change 1+ import language .experimental .captureChecking
2+ def runOps [C ^ ](ops : List [() -> {C } Unit ]): Unit = ops.foreach(_()) // ok
3+ trait Ops [C ^ ] { def toList : List [() -> {C } Unit ] }
4+ def runOpsAlt1 [C1 ^ ](ops : Ops [C1 ]): Unit = runOps[{C1 }](??? ) // was error, now ok
5+ def runOpsAlt2 [C2 ^ ](ops : Ops [{}]^ {C2 }): Unit = runOps[{C2 }](??? ) // ok
6+ def runOpsAlt3 [C3 ^ ](ops : Ops [C3 ]^ {C3 }): Unit = runOps[{C3 }](??? ) // was error, no ok
You can’t perform that action at this time.
0 commit comments