Skip to content

Commit 9f94dc2

Browse files
authored
Fix check files to make build work again (#24595)
1 parent 2953eab commit 9f94dc2

File tree

3 files changed

+20
-24
lines changed

3 files changed

+20
-24
lines changed

tests/neg-custom-args/captures/consume-tvar-bound.check

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:9:44 ----------------------------
2-
9 |def hh[T <: Ref^](x: Box[T]): (Ref^, Int) = (x.elem, 1) // error (but msg is strange since it does not highlight the underlying box conflict)
3-
| ^^^^^^^^^^^
4-
| Found: (T^'s1, Int)
5-
| Required: (Ref^, Int)
6-
|
7-
| Note that capability cap is not included in capture set {}.
8-
|
9-
| where: ^ refers to a fresh root capability in the result type of method hh
10-
| cap is a fresh root capability in the type of type T
11-
|
12-
| longer explanation available when compiling with `-explain`
131
-- Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:7:29 -------------------------------------------------
142
7 |def h[T <: Ref^](x: Box[T]): Ref^ = x.elem // error
153
| ^^^^
164
| Separation failure: method h's result type Ref^ hides cap, which appears in the bound of type T.
175
| This is not allowed. The type T has to be returned explicitly in the result type.
186
|
197
| where: cap is a fresh root capability in the type of type T
8+
-- Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:9:30 -------------------------------------------------
9+
9 |def hh[T <: Ref^](x: Box[T]): (Ref^, Int) = (x.elem, 1) // error (but msg is strange since it does not highlight the underlying box conflict)
10+
| ^^^^^^^^^^^
11+
| Separation failure: method hh's result type (Ref^, Int) hides cap, which appears in the bound of type T.
12+
| This is not allowed. The type T has to be returned explicitly in the result type.
13+
|
14+
| where: cap is a fresh root capability in the type of type T
2015
-- Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:11:37 ------------------------------------------------
2116
11 |def g[T <: Ref^](consume x: Box[T]): Ref^ = x.elem // error
2217
| ^^^^

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/pos/i24543.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import scala.language.experimental.captureChecking
2+
// no separation checking
3+
4+
class Ref
5+
case class Box[T](elem: T)
6+
7+
def h1[T <: Ref^](x: Box[T]): Unit =
8+
val y: (Ref^, Int) = (x.elem, 1) // would be sep error
9+
10+
def h2[T <: Ref^](x: List[T]): (Ref^, Int) = (x.head, 1) // would be sep error
11+
12+
13+

0 commit comments

Comments
 (0)