We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f23b9dc commit 6335372Copy full SHA for 6335372
tests/neg-custom-args/captures/capset-members4.scala
@@ -0,0 +1,27 @@
1
+import language.experimental.captureChecking
2
+import language.experimental.modularity
3
+import caps.*
4
+
5
+def test =
6
+ val x: Any^ = ???
7
+ val y: Any^ = ???
8
+ val z: Any^ = ???
9
+ def onlyWithZ[cap C](using c: Contains[C, z.type]) = ???
10
11
+ trait IncludesZ[cap C]:
12
+ val c: Contains[C, z.type]
13
14
+ trait Foo:
15
+ cap type C >: {x} <: {x,y,z} : IncludesZ
16
17
+ val foo: Foo = ???
18
+/* new Foo {
19
+ override given IncludesZ[C]: // FIXME: doesn't work yet
20
+ val c: Contains[C, z.type] = summon
21
+ cap type C = {x,z}
22
+ } */
23
+ onlyWithZ(using foo.C.c)
24
+ onlyWithZ[{z}]
25
+ onlyWithZ[{x,z}]
26
+ onlyWithZ[{x,y,z}]
27
+ onlyWithZ[{x,y}] // error
0 commit comments