Skip to content

Commit 3c69f59

Browse files
committed
Drop some TODOs in tests, explain others
1 parent 3e7d84a commit 3c69f59

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:9:22 ------------------------------------
2-
9 | val _: () -> Unit = h // error: should be ->{io}
3-
| ^
4-
| Found: (h : () ->{io} Unit)
5-
| Required: () -> Unit
6-
|
7-
| longer explanation available when compiling with `-explain`
8-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:11:50 -----------------------------------
9-
11 | val _: () -> List[Object^{io}] -> Object^{io} = h2 // error, should be ->{io}
1+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:11:22 -----------------------------------
2+
11 | val _: () -> Unit = h // error: should be ->{io}
3+
| ^
4+
| Found: (h : () ->{io} Unit)
5+
| Required: () -> Unit
6+
|
7+
| longer explanation available when compiling with `-explain`
8+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:13:50 -----------------------------------
9+
13 | val _: () -> List[Object^{io}] -> Object^{io} = h2 // error, should be ->{io}
1010
| ^^
1111
| Found: (h2 : () ->{} List[Object^{io}]^{} ->{io} Object^{io})
1212
| Required: () -> List[Object^{io}] -> Object^{io}

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)