File tree 2 files changed +32
-0
lines changed
tests/neg-custom-args/captures
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
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)
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments