Skip to content

Commit e251a48

Browse files
Update tests specifically about distributing &
1 parent da4b886 commit e251a48

File tree

6 files changed

+9
-33
lines changed

6 files changed

+9
-33
lines changed

tests/neg-deep-subtype/i11064.scala

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ trait Foo[T <: Foo[T]] {
22
type I <: Foo[I]
33
}
44

5-
trait Bar[T <: Foo[T]] extends Foo[T] { // error: cyclic
5+
trait Bar[T <: Foo[T]] extends Foo[T] { // was error: cyclic
66
self: T =>
77
}

tests/pos/i11064.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ trait Ops[T <: TypedArray[_, T]] {
55
}
66

77
object Test {
8-
def test(ops: Ops[_ <: TypedArray[_, _]]) = ops.typedArray()
8+
def test1(ops: Ops[_ <: TypedArray[_, _]]) = ops.typedArray()
9+
def test2(ops: Ops[_ <: TypedArray[_ <: AnyRef, _]]) = ops.typedArray() // ok, was error: Recursion limit exceeded.
910
}

tests/pos/i5980.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ trait B
44
trait Covariant[F[+_]] {
55
trait G[+X]
66

7-
def fx: F[A & B] = fy
7+
def fx: F[A & B] = ???
88
def fy: F[A] & F[B] = fx
99

10-
def gx: G[A & B] = gy
10+
def gx: G[A & B] = ???
1111
def gy: G[A] & G[B] = gx
1212
}
1313

1414
trait Contravariant[F[-_]] {
1515
trait G[-X]
1616

17-
def fx: F[A | B] = fy
17+
def fx: F[A | B] = ???
1818
def fy: F[A] & F[B] = fx
1919

20-
def gx: G[A | B] = gy
20+
def gx: G[A | B] = ???
2121
def gy: G[A] & G[B] = gx
2222
}
2323

@@ -28,7 +28,5 @@ trait LiskovViolation[F[+_]] {
2828

2929
def fc1: C = new C {}
3030
def fc2: A & B = fc1
31-
32-
def fy1: F[A & B] = fc1.children
33-
def fy2: F[A & B] = fc2.children
31+
def fy2: F[A] & F[B] = fc2.children
3432
}

tests/pos/i7965.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ trait Z
55

66
abstract class Test {
77
def x: Has[X] | (Has[Y] & Has[Z])
8-
val y: Has[? >: (X & Y) | (X & Z) <: (X | Y) & (X | Z)] = x
9-
108
def foo[T <: Has[_]](has: T): T = has
119
foo(x)
1210
}

tests/pos/intersection.scala

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ object intersection {
1818

1919

2020
class C[-T]
21-
def f: C[A] & C[B] = ???
22-
def g: C[A | B] = f
21+
def g: C[A | B] = ???
2322
def h: C[A] & C[B] = g
2423
}
2524
object Test {
@@ -41,14 +40,3 @@ object Test {
4140
def fooBA = (??? : B with A).f
4241
def fooBA1: Int = fooBA
4342
}
44-
45-
object Test2:
46-
class Row[+X]
47-
class A
48-
class B
49-
class C extends Row[A]
50-
class D extends Row[B]
51-
val x: C & D = ???
52-
val y: Row[A & B] = x
53-
54-

0 commit comments

Comments
 (0)