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 @@ -1644,7 +1644,8 @@ object CaptureSet:
16441644 else this (acc, parent)
16451645
16461646 def abstractTypeCase (acc : CaptureSet , t : TypeRef , upperBound : Type ) =
1647- if includeTypevars && upperBound.isExactlyAny then fresh(Origin .DeepCS (t))
1647+ if t.derivesFrom(defn.Caps_CapSet ) then t.singletonCaptureSet
1648+ else if includeTypevars && upperBound.isExactlyAny then fresh(Origin .DeepCS (t))
16481649 else this (acc, upperBound)
16491650
16501651 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