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)
9494 def retainedElementsRaw (using Context ): List [Type ] = tp match
9595 case OrType (tp1, tp2) =>
9696 tp1.retainedElementsRaw ++ tp2.retainedElementsRaw
97+ case AnnotatedType (tp1, ann) if tp1.derivesFrom(defn.Caps_CapSet ) && ann.symbol.isRetains =>
98+ ann.tree.retainedSet.retainedElementsRaw
9799 case tp =>
98100 // Nothing is a special type to represent the empty set
99101 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