Skip to content

Commit 498f43d

Browse files
committed
Require -source future for separation checking being turned on
1 parent a210cb8 commit 498f43d

22 files changed

+46
-40
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object ccConfig:
5353
Feature.sourceVersion.stable != SourceVersion.`3.5`
5454

5555
def useFresh(using Context): Boolean =
56-
Feature.sourceVersion.stable.isAtLeast(SourceVersion.`3.6`)
56+
Feature.sourceVersion.stable.isAtLeast(SourceVersion.`future`)
5757

5858
end ccConfig
5959

tests/neg-custom-args/captures/box-adapt-cases.check

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/box-adapt-cases.scala:7:10 -------------------------------
2-
7 | x.value(cap => cap.use()) // error, was OK
1+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/box-adapt-cases.scala:8:10 -------------------------------
2+
8 | x.value(cap => cap.use()) // error, was OK
33
| ^^^^^^^^^^^^^^^^
44
| Found: (cap: box Cap^?) => Int
55
| Required: (cap: box Cap^) ->{fresh} Int
66
|
77
| longer explanation available when compiling with `-explain`
8-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/box-adapt-cases.scala:14:10 ------------------------------
9-
14 | x.value(cap => cap.use()) // error
8+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/box-adapt-cases.scala:15:10 ------------------------------
9+
15 | x.value(cap => cap.use()) // error
1010
| ^^^^^^^^^^^^^^^^
1111
| Found: (cap: box Cap^?) ->{io} Int
1212
| Required: (cap: box Cap^{io}) -> Int
1313
|
1414
| longer explanation available when compiling with `-explain`
15-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/box-adapt-cases.scala:28:10 ------------------------------
16-
28 | x.value(cap => cap.use()) // error
15+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/box-adapt-cases.scala:29:10 ------------------------------
16+
29 | x.value(cap => cap.use()) // error
1717
| ^^^^^^^^^^^^^^^^
1818
| Found: (cap: box Cap^?) ->{io, fs} Int
1919
| Required: (cap: box Cap^{io, fs}) ->{io} Int

tests/neg-custom-args/captures/box-adapt-cases.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import language.future // sepchecks on
12
trait Cap { def use(): Int }
23

34
def test1(): Unit = {

tests/neg-custom-args/captures/depfun-reach.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import language.experimental.captureChecking
22
import caps.cap
3-
3+
import language.future // sepchecks on
44
def test(io: Object^, async: Object^) =
55
def compose(op: List[(() ->{cap} Unit, () ->{cap} Unit)]): List[() ->{op*} Unit] =
66
List(() => op.foreach((f,g) => { f(); g() }))

tests/neg-custom-args/captures/existential-mapping.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import language.experimental.captureChecking
2-
2+
import language.future // sepchecks on
33
class A
44
class C
55
type Fun[X] = (x: C^) -> X

tests/neg-custom-args/captures/filevar-expanded.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import language.experimental.captureChecking
22
import language.experimental.modularity
33
import compiletime.uninitialized
4-
4+
import language.future // sepchecks on
55
object test1:
66
class File:
77
def write(x: String): Unit = ???

tests/neg-custom-args/captures/i19330.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
2-
1+
import language.future // sepchecks on
32
import language.experimental.captureChecking
43

4+
55
trait Logger
66
def usingLogger[T](op: Logger^ => T): T = ???
77

tests/neg-custom-args/captures/i21614.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import language.experimental.captureChecking
22
import caps.Capability
33
import caps.use
4-
4+
import language.future // sepchecks on
55
trait List[+T]:
66
def map[U](f: T => U): List[U]
77

tests/neg-custom-args/captures/lazyref.check

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:19:28 --------------------------------------
2-
19 | val ref1c: LazyRef[Int] = ref1 // error
1+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:20:28 --------------------------------------
2+
20 | val ref1c: LazyRef[Int] = ref1 // error
33
| ^^^^
44
| Found: (ref1 : LazyRef[Int]{val elem: () ->{cap1} Int}^{cap1})
55
| Required: LazyRef[Int]
66
|
77
| longer explanation available when compiling with `-explain`
8-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:21:35 --------------------------------------
9-
21 | val ref2c: LazyRef[Int]^{cap2} = ref2 // error
8+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:22:35 --------------------------------------
9+
22 | val ref2c: LazyRef[Int]^{cap2} = ref2 // error
1010
| ^^^^
1111
| Found: LazyRef[Int]{val elem: () ->{ref2*} Int}^{ref2}
1212
| Required: LazyRef[Int]^{cap2}
1313
|
1414
| longer explanation available when compiling with `-explain`
15-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:23:35 --------------------------------------
16-
23 | val ref3c: LazyRef[Int]^{ref1} = ref3 // error
15+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:24:35 --------------------------------------
16+
24 | val ref3c: LazyRef[Int]^{ref1} = ref3 // error
1717
| ^^^^
1818
| Found: LazyRef[Int]{val elem: () ->{ref3*} Int}^{ref3}
1919
| Required: LazyRef[Int]^{ref1}
2020
|
2121
| longer explanation available when compiling with `-explain`
22-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:25:35 --------------------------------------
23-
25 | val ref4c: LazyRef[Int]^{cap1} = ref4 // error
22+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:26:35 --------------------------------------
23+
26 | val ref4c: LazyRef[Int]^{cap1} = ref4 // error
2424
| ^^^^
2525
| Found: LazyRef[Int]{val elem: () ->{ref4*} Int}^{ref4}
2626
| Required: LazyRef[Int]^{cap1}
2727
|
2828
| longer explanation available when compiling with `-explain`
29-
-- Error: tests/neg-custom-args/captures/lazyref.scala:24:55 -----------------------------------------------------------
30-
24 | val ref4 = (if cap1 == cap2 then ref1 else ref2).map(g) // error: separation failure
29+
-- Error: tests/neg-custom-args/captures/lazyref.scala:25:55 -----------------------------------------------------------
30+
25 | val ref4 = (if cap1 == cap2 then ref1 else ref2).map(g) // error: separation failure
3131
| ^
3232
|Separation failure: argument of type (x: Int) ->{cap2} Int
3333
|to method map: [U](f: T => U): LazyRef[U]^{f, LazyRef.this}

tests/neg-custom-args/captures/lazyref.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import language.future // sepchecks on
12
class CC
23
type Cap = CC^
34

0 commit comments

Comments
 (0)