Skip to content

Commit ce1920d

Browse files
committed
Update tests can check files
1 parent 155f3fe commit ce1920d

File tree

20 files changed

+50
-50
lines changed

20 files changed

+50
-50
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
10 | h(f2()) // error
33
| ^^^^
44
| Found: (x$0: Int) ->{cap1} Int
5-
| Required: Int ->{cap2} Int
5+
| Required: (x$0: Int) ->{cap2} Int
66
|
77
| longer explanation available when compiling with `-explain`
88
-- Error: tests/neg-custom-args/captures/byname.scala:19:5 -------------------------------------------------------------

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
-- Error: tests/neg-custom-args/captures/capt1.scala:32:30 -------------------------------------------------------------
3737
32 | val z2 = h[() -> Cap](() => x) // error
3838
| ^
39-
| (x : C^{cap[foo]}) cannot be referenced here; it is not included in the allowed capture set {}
40-
| of an enclosing function literal with expected type () -> box C^{cap[foo]}
39+
| (x : C^{cap[<root>]}) cannot be referenced here; it is not included in the allowed capture set {}
40+
| of an enclosing function literal with expected type () -> box C^{cap[<root>]}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:20:46 ---------------------------------------
77
20 | val boxed1 : ((C^) => Unit) -> Unit = box1(c) // error
88
| ^^^^^^^
9-
| Found: (C{val arg: C^{cap[C]}}^{c} ->{cap[main1], c} Unit) ->{c} Unit
10-
| Required: (C^{cap[main1]} ->{cap[main1]} Unit) -> Unit
9+
| Found: (C{val arg: C^{cap[C]}}^{c} ->{'cap[main1..boxed1](from instantiating box1), c} Unit) ->{c} Unit
10+
| Required: (C^{cap[boxed1]} ->{cap[boxed1]} Unit) -> Unit
1111
|
1212
| longer explanation available when compiling with `-explain`
1313
-- Error: tests/neg-custom-args/captures/i15772.scala:26:26 ------------------------------------------------------------
@@ -18,15 +18,15 @@
1818
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:27:35 ---------------------------------------
1919
27 | val boxed2 : Observe[C^] = box2(c) // error
2020
| ^^^^^^^
21-
| Found: (C{val arg: C^{cap[C]}}^{c} ->{cap[main2], c} Unit) ->{c} Unit
22-
| Required: (C^{cap[main2]} ->{cap[main2]} Unit) -> Unit
21+
| Found: (C{val arg: C^{cap[C]}}^{c} ->{'cap[main2..boxed2](from instantiating box2), c} Unit) ->{c} Unit
22+
| Required: (C^{cap[boxed2]} ->{cap[boxed2]} Unit) -> Unit
2323
|
2424
| longer explanation available when compiling with `-explain`
2525
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:33:33 ---------------------------------------
2626
33 | val boxed2 : Observe[C]^ = box2(c) // error
2727
| ^^^^^^^
28-
| Found: (C{val arg: C^{cap[C]}}^{'cap[..main3](from instantiating c)} ->{cap[main3]} Unit) ->? Unit
29-
| Required: (C ->{cap[main3]} Unit) ->{cap[main3]} Unit
28+
| Found: (C{val arg: C^{cap[C]}}^{cap[main3]} ->{cap[main3]} Unit) ->{cap[main3]} Unit
29+
| Required: (C ->{cap[boxed2]} Unit) ->{cap[boxed2]} Unit
3030
|
3131
| longer explanation available when compiling with `-explain`
3232
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:44:2 ----------------------------------------

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
22 | def tail: LazyList[Nothing]^ = ??? // error overriding
3838
| ^
3939
| error overriding method tail in class LazyList of type -> lazylists.LazyList[Nothing];
40-
| method tail of type -> lazylists.LazyList[Nothing]^{cap[tail]} has incompatible type
40+
| method tail of type -> lazylists.LazyList[Nothing]^{cap[<root>]} has incompatible type
4141
|
4242
| longer explanation available when compiling with `-explain`

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:21:35 --------------------------------------
99
21 | val ref2c: LazyRef[Int]^{cap2} = ref2 // error
1010
| ^^^^
11-
| Found: (ref2 : LazyRef[Int]{val elem: () ->{cap[test]} Int}^{cap2, ref1})
12-
| Required: LazyRef[Int]^{cap2}
11+
| Found: (ref2 : LazyRef[Int]{val elem: () ->{cap[<root>]} Int}^{cap2, ref1})
12+
| Required: LazyRef[Int]^{cap2}
1313
|
1414
| longer explanation available when compiling with `-explain`
1515
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:23:35 --------------------------------------
1616
23 | val ref3c: LazyRef[Int]^{ref1} = ref3 // error
1717
| ^^^^
18-
| Found: (ref3 : LazyRef[Int]{val elem: () ->{cap[test]} Int}^{cap2, ref1})
19-
| Required: LazyRef[Int]^{ref1}
18+
| Found: (ref3 : LazyRef[Int]{val elem: () ->{cap[<root>]} Int}^{cap2, ref1})
19+
| Required: LazyRef[Int]^{ref1}
2020
|
2121
| longer explanation available when compiling with `-explain`
2222
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:25:35 --------------------------------------
2323
25 | val ref4c: LazyRef[Int]^{cap1} = ref4 // error
2424
| ^^^^
25-
| Found: (ref4 : LazyRef[Int]{val elem: () ->{cap[test]} Int}^{cap2, cap1})
26-
| Required: LazyRef[Int]^{cap1}
25+
| Found: (ref4 : LazyRef[Int]{val elem: () ->{cap[<root>]} Int}^{cap2, cap1})
26+
| Required: LazyRef[Int]^{cap1}
2727
|
2828
| longer explanation available when compiling with `-explain`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-- Error: tests/neg-custom-args/captures/leaked-curried.scala:13:20 ----------------------------------------------------
22
13 | () => () => io // error
33
| ^^
4-
|(io : Cap^{cap[main]}) cannot be referenced here; it is not included in the allowed capture set {} of pure base class trait Pure
4+
|(io : Cap^{cap[<root>]}) cannot be referenced here; it is not included in the allowed capture set {} of pure base class trait Pure
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/levels.scala:15:11 ---------------------------------------
2-
15 | r.setV(g) // error
1+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/levels.scala:14:11 ---------------------------------------
2+
14 | r.setV(g) // error
33
| ^
44
| Found: box (x: String) ->{cap3} String
55
| Required: box (x$0: String) ->? String
66
|
7-
| Note that reference (cap3 : CC^{cap[scope]}), defined at level 2
8-
| cannot be included in outer capture set ?, defined at level 1 in method test
7+
| Note that reference (cap3 : CC^{cap[scope]}), defined in method scope
8+
| cannot be included in outer capture set ? which is associated with method test
99
|
1010
| longer explanation available when compiling with `-explain`

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ def test(cap1: CC^) =
99

1010
val r = Ref((x: String) => x)
1111

12-
def scope =
13-
val cap3: CC^ = ???
12+
def scope(cap3: CC^) =
1413
def g(x: String): String = if cap3 == cap3 then "" else "a"
1514
r.setV(g) // error
1615
()
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
class C:
2+
this: C^ =>
3+
24
def x: C^{cap[d]} = ??? // error
35

46
def y: C^{cap[C]} = ??? // ok
5-
private val z = (x: Int) => (c: C^{cap[z]}) => x // ok
7+
private val z = (c0: caps.Cap) => (x: Int) => (c: C^{cap[z]}) => x // ok
68

79
private val z2 = identity((x: Int) => (c: C^{cap[z2]}) => x) // error

tests/neg-custom-args/captures/real-try.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
|(canThrow$4 : CanThrow[Ex1 | Ex2]^{cap[<try block>]}) cannot be referenced here; it is not included in the allowed capture set ?
2525
|of an enclosing function literal with expected type box () ->? Unit
2626
|
27-
|Note that reference (canThrow$4 : CanThrow[Ex1 | Ex2]^{cap[<try block>]}), defined at level 2
28-
|cannot be included in outer capture set ?, defined at level 1 in method test
27+
|Note that reference (canThrow$4 : CanThrow[Ex1 | Ex2]^{cap[<try block>]}), defined in method <try block>
28+
|cannot be included in outer capture set ? which is associated with package <root>

tests/neg-custom-args/captures/simple-escapes.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
16 | foo = f // error
33
| ^
44
| Found: box FileOutputStream^{f}
5-
| Required: box FileOutputStream^{cap[Test1]}
5+
| Required: box FileOutputStream^{cap[<root>]}
66
|
77
| longer explanation available when compiling with `-explain`
88
-- Error: tests/neg-custom-args/captures/simple-escapes.scala:19:15 ----------------------------------------------------

tests/neg-custom-args/captures/usingLogFile-alt.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
| ^^^^^^^^^
44
| reference (file : java.io.OutputStream^{lcap}) is not included in the allowed capture set {x$0, x$0²}
55
|
6-
| Note that reference (file : java.io.OutputStream^{lcap}), defined at level 1
7-
| cannot be included in outer capture set {x$0, x$0}, defined at level 0 in package <root>
6+
| Note that reference (file : java.io.OutputStream^{lcap}), defined in method $anonfun
7+
| cannot be included in outer capture set {x$0, x$0} which is associated with package <root>
88
|
99
| where: x$0 is a reference to a value parameter
1010
| x$0² is a reference to a value parameter

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
| ^^^^^^^^^
3232
| reference (_$1 : java.io.OutputStream^{local}) is not included in the allowed capture set {x$0, local}
3333
|
34-
| Note that reference (_$1 : java.io.OutputStream^{local}), defined at level 2
35-
| cannot be included in outer capture set {x$0, local}, defined at level 1 in method test
34+
| Note that reference (_$1 : java.io.OutputStream^{local}), defined in method $anonfun
35+
| cannot be included in outer capture set {x$0, local} which is associated with package <root>

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@
55
| Required: () -> Unit
66
|
77
| longer explanation available when compiling with `-explain`
8-
-- Error: tests/neg-custom-args/captures/vars.scala:23:14 --------------------------------------------------------------
9-
23 | a = x => g(x) // error
8+
-- Error: tests/neg-custom-args/captures/vars.scala:22:14 --------------------------------------------------------------
9+
22 | a = x => g(x) // error
1010
| ^^^^
1111
| reference (cap3 : CC^{cap[scope]}) is not included in the allowed capture set {cap[test]}
1212
| of an enclosing function literal with expected type box String ->{cap[test]} String
13-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/vars.scala:24:8 ------------------------------------------
14-
24 | a = g // error
13+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/vars.scala:23:8 ------------------------------------------
14+
23 | a = g // error
1515
| ^
1616
| Found: box (x: String) ->{cap3} String
17-
| Required: box String ->{cap[test]} String
17+
| Required: box (x$0: String) ->{cap[test]} String
1818
|
1919
| longer explanation available when compiling with `-explain`
20-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/vars.scala:26:13 -----------------------------------------
21-
26 | b = List(g) // error
20+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/vars.scala:25:13 -----------------------------------------
21+
25 | b = List(g) // error
2222
| ^
2323
| Found: Seq[(x: String) ->{cap3} String]
2424
| Required: Seq[box (x$0: String) ->{cap3} String]
2525
|
2626
| longer explanation available when compiling with `-explain`
27-
-- Error: tests/neg-custom-args/captures/vars.scala:35:2 ---------------------------------------------------------------
28-
35 | local { root => cap3 => // error
27+
-- Error: tests/neg-custom-args/captures/vars.scala:34:2 ---------------------------------------------------------------
28+
34 | local { root => cap3 => // error
2929
| ^^^^^
3030
| escaping local reference root.type

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ def test(cap1: Cap, cap2: Cap) =
1616
a("") // was error, now ok
1717
b.head // was error, now ok
1818

19-
def scope =
20-
val cap3: Cap = CC()
19+
def scope(cap3: Cap) =
2120
def g(x: String): String = if cap3 == cap3 then "" else "a"
2221
def h(): String = ""
2322
a = x => g(x) // error
@@ -27,8 +26,8 @@ def test(cap1: Cap, cap2: Cap) =
2726
val gc = g
2827
g
2928

30-
val s = scope
31-
val sc: String => String = scope
29+
val s = scope(new CC)
30+
val sc: String => String = scope(new CC)
3231

3332
def local[T](op: (local: caps.Cap) -> CC^{local} -> T): T = op(caps.cap)(CC())
3433

tests/pos-custom-args/captures/capt2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test2() =
1313
z: (() -> Unit) @retains(x)
1414
def z2: (() -> Unit) @retains(y) = y
1515
z2: (() -> Unit) @retains(y)
16-
val p: () ->{cap[test2]} String = () => "abc"
16+
val p: () => String = () => "abc"
1717
val q: C^{p} = ???
1818
val _ = p: (() ->{p} String)
1919

tests/pos-custom-args/captures/lists.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test(c: Cap, d: Cap, e: Cap) =
3030
CONS(z, ys)
3131
val zsc: LIST[Cap ->{d, y} Unit] = zs
3232
val z1 = zs.head
33-
val z1c: Cap ->{y, d} Unit = z1
33+
val z1c: Cap^{cap[test]} ->{y, d} Unit = z1
3434
val ys1 = zs.tail
3535
val y1 = ys1.head
3636

tests/pos-custom-args/captures/pairs.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ object Generic:
1313
def g(x: Cap): Unit = if d == x then ()
1414
val p = Pair(f, g)
1515
val x1 = p.fst
16-
val x1c: Cap ->{c} Unit = x1
16+
val x1c: Cap^{cap[test]} ->{c} Unit = x1
1717
val y1 = p.snd
18-
val y1c: Cap ->{d} Unit = y1
18+
val y1c: Cap^{cap[test]} ->{d} Unit = y1
1919

2020
object Monomorphic:
2121

tests/pos-special/stdlib/Test2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Test {
88
def seqOps(xs: Seq[Int]) = { // try with Seq[Int]^{cap}
99
val strPlusInt: (String, Int) => String = _ + _
1010
val intPlusStr: (Int, String) => String = _ + _
11-
val isEven: Int ->{cap[seqOps]} Boolean = _ % 2 == 0
11+
val isEven: Int => Boolean = _ % 2 == 0
1212
val isNonNeg: Int => Boolean = _ > 0
1313
val flips: Int => List[Int] = x => x :: -x :: Nil
1414
val x1 = xs.foldLeft("")(strPlusInt)

tests/run-custom-args/captures/colltest5/Test_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Test {
88
def seqOps(xs: Seq[Int]) = { // try with Seq[Int]^{cap}
99
val strPlusInt: (String, Int) => String = _ + _
1010
val intPlusStr: (Int, String) => String = _ + _
11-
val isEven: Int ->{cap[seqOps]} Boolean = _ % 2 == 0
11+
val isEven: Int => Boolean = _ % 2 == 0
1212
val isNonNeg: Int => Boolean = _ > 0
1313
val flips: Int => List[Int] = x => Cons(x, Cons(-x, Nil))
1414
val x1 = xs.foldLeft("")(strPlusInt)

0 commit comments

Comments
 (0)