Skip to content

Changes in preparation to make caps.Capability stable #22849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 24, 2025
Merged
Prev Previous commit
Rename caps.* to caps.cap
  • Loading branch information
natsukagami committed Mar 24, 2025
commit e07db84ad72a2ffa5ef103e362a390eb398f7c73
4 changes: 2 additions & 2 deletions tests/disabled/neg-custom-args/captures/capt-wf.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// No longer valid
class C
type Cap = C @retains(caps.*)
type Top = Any @retains(caps.*)
type Cap = C @retains(caps.cap)
type Top = Any @retains(caps.cap)

type T = (x: Cap) => List[String @retains(x)] => Unit // error
val x: (x: Cap) => Array[String @retains(x)] = ??? // error
Expand Down
2 changes: 1 addition & 1 deletion tests/disabled/neg-custom-args/captures/try2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import annotation.ability
@ability erased val canThrow: * = ???

class CanThrow[E <: Exception] extends Retains[canThrow.type]
type Top = Any @retains(caps.*)
type Top = Any @retains(caps.cap)

infix type throws[R, E <: Exception] = (erased CanThrow[E]) ?=> R

Expand Down
2 changes: 1 addition & 1 deletion tests/pos/caps-universal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import annotation.retains

val id: Int -> Int = (x: Int) => x
val foo: Int => Int = id
val bar: (Int -> Int) @retains(caps.*) = foo
val bar: (Int -> Int) @retains(caps.cap) = foo



Expand Down
Loading