Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Nov 22, 2024
1 parent 3e443b6 commit c933560
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
7 changes: 0 additions & 7 deletions tests/neg/cc-poly-2.check
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
-- [E007] Type Mismatch Error: tests/neg/cc-poly-2.scala:13:15 ---------------------------------------------------------
13 | f[Nothing](d) // error
| ^
| Found: (d : Test.D^)
| Required: Test.D
|
| longer explanation available when compiling with `-explain`
-- [E007] Type Mismatch Error: tests/neg/cc-poly-2.scala:14:19 ---------------------------------------------------------
14 | f[CapSet^{c1}](d) // error
| ^
Expand Down
2 changes: 1 addition & 1 deletion tests/neg/cc-poly-2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Test:

def test(c1: C, c2: C) =
val d: D^ = D()
f[Nothing](d) // error
// f[Nothing](d) // already rule out at typer
f[CapSet^{c1}](d) // error
val x = f(d)
val _: D^{c1} = x // error
5 changes: 3 additions & 2 deletions tests/pos/cc-poly-source-capability.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import caps.unbox

def test1(async1: Async, @unbox others: List[Async]) =
val src = Source[CapSet^{async1, others*}]
val _: Set[Listener^{async1, others*}] = src.allListeners
val lst1 = listener(async1)
val lsts = others.map(listener)
val _: List[Listener^{others*}] = lsts
src.register{lst1}
src.register(listener(async1))
lsts.foreach(src.register)
others.map(listener).foreach(src.register)
lsts.foreach(src.register(_)) // TODO: why we need to use _ explicitly here?
others.map(listener).foreach(src.register(_))
val ls = src.allListeners
val _: Set[Listener^{async1, others*}] = ls

Expand Down

0 comments on commit c933560

Please sign in to comment.