File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
compiler/src/dotty/tools/dotc/cc
tests/pos-custom-args/captures Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ extension (tp: Type)
94
94
def retainedElementsRaw (using Context ): List [Type ] = tp match
95
95
case OrType (tp1, tp2) =>
96
96
tp1.retainedElementsRaw ++ tp2.retainedElementsRaw
97
+ case AnnotatedType (tp1, ann) if tp1.derivesFrom(defn.Caps_CapSet ) && ann.symbol.isRetains =>
98
+ ann.tree.retainedSet.retainedElementsRaw
97
99
case tp =>
98
100
// Nothing is a special type to represent the empty set
99
101
if tp.isNothingType then Nil
Original file line number Diff line number Diff line change
1
+ def f [C ^ ](xs : List [() -> {C } Unit ]): List [() -> {C } Unit ] =
2
+ xs.reverse
3
+
4
+ def test (io : Object ^ , async : Object ^ ): Unit =
5
+ val ok = f[{io}](Nil )
6
+ val x = f[{io}] // was error
7
+ val y = f[{io, async}] // was error
You can’t perform that action at this time.
0 commit comments