Skip to content

Commit ae3f52e

Browse files
committed
update check files after refactoring box adaptation
1 parent 43ca7c6 commit ae3f52e

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ class CheckCaptures extends Recheck, SymTransformer:
606606
val (eargs, eres) = expected.dealias match
607607
case defn.FunctionOf(eargs, eres, _, _) => (eargs, eres)
608608
case _ => (aargs.map(_ => WildcardType), WildcardType)
609-
val aargs1 = aargs.zipWithConserve(eargs){ (aarg, earg) => adapt(aarg, earg, !covariant) }
609+
val aargs1 = aargs.zipWithConserve(eargs) { (aarg, earg) => adapt(aarg, earg, !covariant) }
610610
val ares1 = adapt(ares, eres, covariant)
611611

612612
val resTp =
@@ -623,9 +623,9 @@ class CheckCaptures extends Recheck, SymTransformer:
623623
i"adapting $actual $arrow $expected"
624624

625625
def adapt(actual: Type, expected: Type, covariant: Boolean): Type = trace(adaptInfo(actual, expected, covariant), recheckr, show = true) {
626-
def destructCapturingType(tp: Type, reconstruct: Type => Type): ((Type, CaptureSet, Boolean), Type => Type) = tp match
626+
def destructCapturingType(tp: Type, reconstruct: Type => Type): ((Type, CaptureSet, Boolean), Type => Type) = tp.dealias match
627627
case tp @ CapturingType(parent, cs) =>
628-
if parent.isCapturingType then
628+
if parent.dealias.isCapturingType then
629629
destructCapturingType(parent, res => reconstruct(tp.derivedCapturingType(res, cs)))
630630
else
631631
((parent, cs, tp.isBoxed), reconstruct)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:32:24 ----------------------------------------
4141
32 | val z2 = h[() -> Cap](() => x) // error
4242
| ^^^^^^^
43-
| Found: {x} () -> {*} C
43+
| Found: {x} () -> Cap
4444
| Required: () -> box {*} C
4545
|
4646
| longer explanation available when compiling with `-explain`
4747
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:33:5 -----------------------------------------
4848
33 | (() => C()) // error
4949
| ^^^^^^^^^
50-
| Found: ? () -> {*} C
50+
| Found: ? () -> Cap
5151
| Required: () -> box {*} C
5252
|
5353
| longer explanation available when compiling with `-explain`

tests/neg-custom-args/captures/curried-simplified.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/curried-simplified.scala:9:28 ----------------------------
99
9 | def y2: () -> () => Int = x2 // error
1010
| ^^
11-
| Found: {x} () -> {*} () -> Int
11+
| Found: {x} () -> () => Int
1212
| Required: () -> () => Int
1313
|
1414
| longer explanation available when compiling with `-explain`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/eta.scala:6:14 -------------------------------------------
99
6 | bar( () => f ) // error
1010
| ^^^^^^^
11-
| Found: {f} () -> box {f} () -> Unit
11+
| Found: {f} () -> box {f} Proc
1212
| Required: () -> box ? () -> Unit
1313
|
1414
| longer explanation available when compiling with `-explain`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:44:2 ----------------------------------------
3131
44 | x: (() -> Unit) // error
3232
| ^
33-
| Found: (x : {sayHello, io} () -> Unit)
33+
| Found: {x} () -> Unit
3434
| Required: () -> Unit
3535
|
3636
| longer explanation available when compiling with `-explain`

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:23:49 ------------------------------------------
22
23 | val a = handle[Exception, CanThrow[Exception]] { // error
33
| ^
4-
| Found: ? ({*} CT[Exception]) -> {*} CT[? >: ? Exception <: ? Exception]
4+
| Found: ? CanThrow[Exception] -> {*} CT[? >: ? Exception <: ? Exception]
55
| Required: CanThrow[Exception] => box {*} CT[Exception]
66
24 | (x: CanThrow[Exception]) => x
77
25 | }{
@@ -10,7 +10,7 @@
1010
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:29:43 ------------------------------------------
1111
29 | val b = handle[Exception, () -> Nothing] { // error
1212
| ^
13-
| Found: ? (x: {*} CT[Exception]) -> {x} () -> ? Nothing
13+
| Found: ? (x: CanThrow[Exception]) -> {x} () -> ? Nothing
1414
| Required: CanThrow[Exception] => () -> Nothing
1515
30 | (x: CanThrow[Exception]) => () => raise(new Exception)(using x)
1616
31 | } {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/vars.scala:11:24 -----------------------------------------
22
11 | val z2c: () -> Unit = z2 // error
33
| ^^
4-
| Found: (z2 : {x, cap1} () -> Unit)
4+
| Found: {z2} () -> Unit
55
| Required: () -> Unit
66
|
77
| longer explanation available when compiling with `-explain`

0 commit comments

Comments
 (0)