Skip to content

Commit 630a20f

Browse files
committed
Fixes in language reference and tests cases
1 parent c8ef6d1 commit 630a20f

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

docs/_docs/reference/experimental/cc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ A common use-case for explicit capture parameters is describing changes to the c
776776
effectful iterators:
777777
```scala
778778
class ConcatIterator[A, C^](var iterators: mutable.List[IterableOnce[A]^{C}]):
779-
def concat(it: IterableOnce[A]^): ConcatIterator[A, {this.C, it}]^{this, it} =
779+
def concat(it: IterableOnce[A]^): ConcatIterator[A, {C, it}]^{this, it} =
780780
iterators ++= it // ^
781781
this // track contents of `it` in the result
782782
```

tests/neg-custom-args/captures/capset-members.scala

+1-27
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,4 @@ class Concrete5(a: AnyRef^, b: AnyRef^) extends Abstract[{a}]:
2727
def boom(): AnyRef^{b} = b // error
2828

2929
class Concrete6(a: AnyRef^, b: AnyRef^) extends Abstract[{a}]:
30-
def boom(): AnyRef^{b} = b // error
31-
32-
33-
trait Ctx[T]
34-
35-
def test =
36-
val x: Any^ = ???
37-
val y: Any^ = ???
38-
object O:
39-
val z: Any^ = ???
40-
trait CaptureSet:
41-
type A^ >: {y} <: {x}
42-
type B = {x}
43-
type C <: {x}
44-
type D^ : Ctx // error
45-
type E <: {C}
46-
type F <: {C}
47-
type G <: {x, y}
48-
type H >: {x} <: {x,y} : Ctx // error
49-
type I^ = {y, G, H}
50-
type J = {O.z}
51-
type K^ = {x, O.z}
52-
type L <: {x, y, O.z}
53-
type M >: {x, y, O.z} <: {C}
54-
type N >: {x} <: {x}
55-
type O >: {O.z} <: {O.z}
56-
type P >: {B,D} // error
30+
def boom(): AnyRef^{b} = b // error
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import language.experimental.captureChecking
2+
import caps.*
3+
4+
trait Ctx[T]
5+
6+
def test =
7+
val x: Any^ = ???
8+
val y: Any^ = ???
9+
object O:
10+
val z: Any^ = ???
11+
trait CaptureSet:
12+
type A^ >: {y} <: {x}
13+
type B = {x}
14+
type C <: {x}
15+
type D^ : Ctx // error
16+
type E <: {C}
17+
type F <: {C}
18+
type G <: {x, y}
19+
type H >: {x} <: {x,y} : Ctx // error
20+
type I^ = {y, G, H}
21+
type J = {O.z}
22+
type K^ = {x, O.z}
23+
type L <: {x, y, O.z}
24+
type M >: {x, y, O.z} <: {C}
25+
type N >: {x} <: {x}
26+
type O >: {O.z} <: {O.z}
27+
type P >: {B,D} // error

0 commit comments

Comments
 (0)