Skip to content

Commit 20917c7

Browse files
committed
Add some tests
1 parent 13e4439 commit 20917c7

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Diff for: tests/neg-custom-args/captures/capset-bound.scala

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import caps.*
2+
3+
class IO
4+
5+
case class File(io: IO^)
6+
7+
def test(io1: IO^, io2: IO^) =
8+
def f[C >: CapSet^{io1} <: CapSet^](file: File^{C^}) = ???
9+
val f1: File^{io1} = ???
10+
val f2: File^{io2} = ???
11+
val f3: File^{io1, io2} = ???
12+
f[CapSet^{io1}](f1)
13+
f[CapSet^{io1}](f2) // error
14+
f[CapSet^{io1}](f3) // error
15+
f[CapSet^{io2}](f2) // error
16+
f[CapSet^{io1, io2}](f1)
17+
f[CapSet^{io1, io2}](f2)
18+
f[CapSet^{io1, io2}](f3)

Diff for: tests/neg-custom-args/captures/i21868.scala

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import caps.
2+
3+
trait AbstractWrong:
4+
type C <: CapSet
5+
def boom(): Unit^{C^} // error
6+
7+
trait Abstract:
8+
type C <: CapSet^
9+
def boom(): Unit^{C^}
10+
11+
class Concrete extends Abstract:
12+
type C = Nothing
13+
def boom() = () // error
14+

0 commit comments

Comments
 (0)