Skip to content

Commit 032fe8a

Browse files
committed
Re-classify tests
- For i15922, it should not work, as both bad1 and bad2 leak scoped capabilities. It is moved to neg tests. - For future-traverse.scala, we could make it work this way. Previously it won't compile because we instantiated the type parameter of `successful` with a universal capability, but actually we needn't do that: we could well pick a local reach capability, as is done in this commit. - For i15749a.scala, it should work but sadly not right now, due to a limitation of our current implementation.
1 parent 6e4cd60 commit 032fe8a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

tests/neg-custom-args/captures/i15749a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def test =
1919
def forceWrapper[A](mx: Wrapper[Unit ->{cap} A]): Wrapper[A] =
2020
// Γ ⊢ mx: Wrapper[□ {cap} Unit => A]
2121
// `force` should be typed as ∀(□ {cap} Unit -> A) A, but it can not
22-
strictMap[Unit ->{cap} A, A](mx)(t => force[A](t)) // error
22+
strictMap[Unit ->{mx*} A, A](mx)(t => force[A](t)) // error // should work

tests/pending/pos-custom-args/captures/i15922.scala renamed to tests/neg-custom-args/captures/i15922.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ def leaking(c: Cap^): Id[Cap^{c}] = mkId(c)
1212

1313
def test =
1414
val ll = (c: Cap^) => leaking(c)
15-
val bad1 = withCap(ll) // used to work, now error (?)
16-
val bad2 = withCap(leaking) // used to work, now error (?)
15+
val bad1 = withCap(ll) // error
16+
val bad2 = withCap(leaking) // error

tests/pending/pos-custom-args/captures/future-traverse.scala renamed to tests/pos-custom-args/captures/future-traverse.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ trait Future[+T] { this: Future[T]^ =>
99
import Future.*
1010
def foldLeft[R](r: R): R = r
1111
def traverse[A, B, M[X] <: IterableOnce[X]](in: M[A]^, bf: BuildFrom[M[A]^, B, M[B]^]): Unit =
12-
foldLeft(successful(bf.newBuilder(in)))
12+
val builder = bf.newBuilder(in)
13+
foldLeft(successful(builder))
1314
}
1415
object Future {
1516
def successful[T](result: T): Future[T] = ???

0 commit comments

Comments
 (0)