File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
tests/neg-custom-args/captures Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i24667.scala:10:18 ---------------------------------------
2+ 10 | val _: AnyRef = w // error on this line
3+ | ^
4+ | Found: (w : O.type)
5+ | Required: AnyRef
6+ |
7+ | Note that capability c is not included in capture set {}.
8+ |
9+ | longer explanation available when compiling with `-explain`
10+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i24667.scala:11:22 ---------------------------------------
11+ 11 | val _: AnyRef^{c} = w // error on this line, since d is also captured
12+ | ^
13+ | Found: (w : O.type)
14+ | Required: Object^{c}
15+ |
16+ | Note that capability O is not included in capture set {c}.
17+ |
18+ | longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change 1+ import language .experimental .captureChecking
2+
3+ def foo (c : AnyRef ^ , d : AnyRef ^ , e : AnyRef ^ ): Unit =
4+ trait I
5+ object O :
6+ val x = c
7+ def foo = println(d)
8+
9+ val w : O .type = O // O is not pure
10+ val _: AnyRef = w // error on this line
11+ val _: AnyRef ^ {c} = w // error on this line, since d is also captured
12+ val _: AnyRef ^ {c, d} = w // ok
13+
You can’t perform that action at this time.
0 commit comments