From c93356082a57a821761c02e58d4eb94d9001e766 Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Fri, 22 Nov 2024 10:58:57 +0100 Subject: [PATCH] Fix tests --- tests/neg/cc-poly-2.check | 7 ------- tests/neg/cc-poly-2.scala | 2 +- tests/pos/cc-poly-source-capability.scala | 5 +++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/neg/cc-poly-2.check b/tests/neg/cc-poly-2.check index 0615ce19b5ea..7a2882775a75 100644 --- a/tests/neg/cc-poly-2.check +++ b/tests/neg/cc-poly-2.check @@ -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 | ^ diff --git a/tests/neg/cc-poly-2.scala b/tests/neg/cc-poly-2.scala index c5e5df6540da..809fa8ae077c 100644 --- a/tests/neg/cc-poly-2.scala +++ b/tests/neg/cc-poly-2.scala @@ -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 diff --git a/tests/pos/cc-poly-source-capability.scala b/tests/pos/cc-poly-source-capability.scala index 3b6c0bde1398..055240c7af4b 100644 --- a/tests/pos/cc-poly-source-capability.scala +++ b/tests/pos/cc-poly-source-capability.scala @@ -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