Skip to content

Commit e30a3c8

Browse files
committed
Drop some TODOs in tests, explain others
1 parent 39684dc commit e30a3c8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

tests/neg-custom-args/captures/use-capset.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import caps.{use, CapSet}
33
def f[C^](xs: List[Object^{C}]): Unit = ???
44

55
private def g[C^] = (xs: List[Object^{C}]) => xs.head // error TODO: allow this
6+
// This fails currently since `C^` is not classified as used. To classify it we'd also have to look on the
7+
// RHS. But this would change again if we go to non-monotonic currying.
68

79
def test(io: Object^)(xs: List[Object^{io}]): Unit =
810
val h = () => f(xs)

tests/pos-custom-args/captures/cc-poly-source-capability.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import caps.use
2727
src.register{lst1}
2828
src.register(listener(async1))
2929
lsts.foreach(src.register(_)) // TODO: why we need to use _ explicitly here?
30-
others.map(listener[C]).foreach(src.register(_)) // TODO: drop [C] and you get illegal capture reference: CapSet
30+
others.map(listener[C]).foreach(src.register(_))
3131
val ls = src.allListeners
3232
val _: Set[Listener^{async1, C}] = ls
3333

tests/pos-custom-args/captures/sep-pairs.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ def copyPair[C^, D^](@consume p: Pair[Ref^{C}, Ref^{D}]): Pair[Ref^{C}, Ref^{D}]
2121

2222
/* TODO: The following variants don't work
2323
24-
def copyPair[C^, D^](@consume p: Pair[Ref^{C}, Ref^{D}]): Pair[Ref^{C}, Ref^{D}] =
24+
def copyPair1[C^, D^](@consume p: Pair[Ref^{C}, Ref^{D}]): Pair[Ref^{C}, Ref^{D}] =
2525
val x: Ref^{C} = p.fst
2626
val y: Ref^{D} = p.snd
2727
Pair(x, y)
2828
29-
def copyPair[C^, D^](@consume p: Pair[Ref^{C}, Ref^{D}]): Pair[Ref^, Ref^] =
29+
def copyPair2[C^, D^](@consume p: Pair[Ref^{C}, Ref^{D}]): Pair[Ref^, Ref^] =
3030
val x: Ref^{C} = p.fst
3131
val y: Ref^{D} = p.snd
3232
Pair(x, y)

0 commit comments

Comments
 (0)