Skip to content

Commit dae9ade

Browse files
committed
Fix tests
1 parent 0fca3e3 commit dae9ade

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

tests/neg/i8861.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object Test {
2020
)
2121
def minimalFail[M](c: Container { type A = M }): M = c.visit(
2222
int = vi => vi.i : vi.A,
23-
str = vs => vs.t : vs.A // error
23+
str = vs => vs.t : vs.A // error // error
2424
)
2525

2626
def main(args: Array[String]): Unit = {

tests/neg/zipped.scala renamed to tests/pos/zipped.scala

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@ object Test {
2222
xs.lazyZip(xs).lazyZip(xs)
2323
.map( (x: Int, y: Int, z: Int) => x + y + z ) // OK
2424

25-
// 4. The single parameter map does not work.
25+
// 4. The single parameter map works through an inserted conversion
2626
xs.lazyZip(xs).lazyZip(xs)
27-
.map( (x: (Int, Int, Int)) => x match { case (x, y, z) => x + y + z }) // error
27+
.map( (x: (Int, Int, Int)) => x match { case (x, y, z) => x + y + z }) // now also OK
2828

29-
// 5. If we leave out the parameter type, we get a "Wrong number of parameters" error instead
29+
// 5. If we leave out the parameter type, it now works as well.
3030
xs.lazyZip(xs).lazyZip(xs)
31-
.map( x => x match { case (x, y, z) => x + y + z }) // error
31+
.map( x => x match { case (x, y, z) => x + y + z }) // now also OK
3232

33-
// This means that the following works in Dotty in normal mode, since a `withFilter`
34-
// is inserted. But it does no work under -strict. And it will not work in Scala 3.1.
35-
// The reason is that without -strict, the code below is mapped to (1), but with -strict
36-
// it is mapped to (5).
33+
// This means that the following works in Dotty 3.0 as well as 3.x
3734
for ((x, y, z) <- xs.lazyZip(xs).lazyZip(xs)) yield x + y + z
3835
}

0 commit comments

Comments
 (0)