Skip to content

Commit a1d73cb

Browse files
committed
Update check files
1 parent 93758e5 commit a1d73cb

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/depfun-reach.scala:13:4 ----------------------------------
2-
13 | op // error
1+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/depfun-reach.scala:19:4 ----------------------------------
2+
19 | op // error
33
| ^^
44
| Found: (xs: List[(X, box () ->{io} Unit)]) ->{op} List[box () ->{xs*} Unit]
55
| Required: (xs: List[(X, box () ->{io} Unit)]) => List[() -> Unit]
66
|
77
| longer explanation available when compiling with `-explain`
8-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/depfun-reach.scala:20:60 ---------------------------------
9-
20 | val b: (xs: List[() ->{io} Unit]) => List[() ->{} Unit] = a // error
8+
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/depfun-reach.scala:26:60 ---------------------------------
9+
26 | val b: (xs: List[() ->{io} Unit]) => List[() ->{} Unit] = a // error
1010
| ^
1111
| Found: (xs: List[box () ->{io} Unit]) ->{a} List[box () ->{xs*} Unit]
1212
| Required: (xs: List[box () ->{io} Unit]) => List[() -> Unit]
1313
|
1414
| longer explanation available when compiling with `-explain`
15-
-- Error: tests/neg-custom-args/captures/depfun-reach.scala:12:17 ------------------------------------------------------
16-
12 | : (xs: List[(X, () ->{io} Unit)]) => List[() ->{} Unit] = // error
15+
-- Error: tests/neg-custom-args/captures/depfun-reach.scala:18:17 ------------------------------------------------------
16+
18 | : (xs: List[(X, () ->{io} Unit)]) => List[() ->{} Unit] = // error
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
|Separation failure: method foo's result type (xs: List[(X, box () ->{io} Unit)]) => List[() -> Unit] hides parameter op.
1919
|The parameter needs to be annotated with @consume to allow this.

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

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import language.experimental.captureChecking
22
import caps.cap
33

4+
trait List[+T]:
5+
def foreach(op: T => Unit): Unit = ???
6+
7+
object List:
8+
def apply[T](elem: T): List[T] = ???
9+
410
def test(io: Object^, async: Object^) =
511
def compose(op: List[(() ->{cap} Unit, () ->{cap} Unit)]): List[() ->{op*} Unit] =
612
List(() => op.foreach((f,g) => { f(); g() }))

tests/neg/polymorphic-erased-functions-types.check

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
4 |def t1b: [T] => (erased t: T) => Unit = [T] => (t: T) => () // error
1010
| ^^^^^^^^^^^^^^^^^^^
1111
| Found: [T] => (t: T) => Unit
12-
| Required: [T] => (erased t: T) => Unit
12+
| Required: [T] => (erased t²: T) => Unit
13+
|
14+
| where: t is a reference to a value parameter
15+
| t² is a reference to a value parameter
1316
|
1417
| longer explanation available when compiling with `-explain`
1518
-- [E007] Type Mismatch Error: tests/neg/polymorphic-erased-functions-types.scala:6:36 ---------------------------------
@@ -23,6 +26,11 @@
2326
7 |def t2b: [T, U] => (t: T, erased u: U) => Unit = [T, U] => (t: T, u: U) => () // error
2427
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2528
| Found: [T, U] => (t: T, u: U) => Unit
26-
| Required: [T, U] => (t: T, erased u: U) => Unit
29+
| Required: [T, U] => (t²: T, erased u²: U) => Unit
30+
|
31+
| where: t is a reference to a value parameter
32+
| t² is a reference to a value parameter
33+
| u is a reference to a value parameter
34+
| u² is a reference to a value parameter
2735
|
2836
| longer explanation available when compiling with `-explain`

tests/neg/polymorphic-functions1.check

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
1 |val f: [T] => (x: T) => x.type = [T] => (x: Int) => x // error
33
| ^^^^^^^^^^^^^^^^^^^^
44
| Found: [T] => (x: Int) => x.type
5-
| Required: [T] => (x: T) => x.type
5+
| Required: [T] => (x²: T) => x².type
6+
|
7+
| where: x is a reference to a value parameter
8+
| x² is a reference to a value parameter
69
|
710
| longer explanation available when compiling with `-explain`

0 commit comments

Comments
 (0)