We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b646a27 commit dca2541Copy full SHA for dca2541
tests/neg-custom-args/captures/cc-glb.check
@@ -0,0 +1,7 @@
1
+-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/cc-glb.scala:7:19 ----------------------------------------
2
+7 | val x2: Foo[T] = x1 // error
3
+ | ^^
4
+ | Found: (x1 : (Foo[T]^) & (Foo[Any]^{io}))
5
+ | Required: Foo[T]
6
+ |
7
+ | longer explanation available when compiling with `-explain`
tests/neg-custom-args/captures/cc-glb.scala
@@ -0,0 +1,8 @@
+import language.experimental.captureChecking
+trait Cap
+trait Foo[+T]
+
+def magic[T](io: Cap^, x: Foo[T]^{io}): Foo[T]^{} =
+ val x1: Foo[T]^{cap} & Foo[Any]^{io} = x
+ val x2: Foo[T] = x1 // error
8
+ x2 // boom, an impure value becomes pure
0 commit comments