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 @@ -1688,7 +1688,8 @@ object CaptureSet:
16881688 else this (acc, parent)
16891689
16901690 def abstractTypeCase (acc : CaptureSet , t : TypeRef , upperBound : Type ) =
1691- if includeTypevars && upperBound.isExactlyAny then fresh(Origin .DeepCS (t))
1691+ if t.derivesFrom(defn.Caps_CapSet ) then t.singletonCaptureSet
1692+ else if includeTypevars && upperBound.isExactlyAny then fresh(Origin .DeepCS (t))
16921693 else this (acc, upperBound)
16931694
16941695 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