Skip to content

Commit 3145891

Browse files
committed
Fix #7859: Add test case
#8409 also fixed this one
1 parent c6b681c commit 3145891

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/pos/i8397.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
given foo(using x: Int) as AnyRef:
22
type T = x.type
33

4+
// #7859
5+
6+
trait Lub2[A, B]:
7+
type Output
8+
9+
given [A <: C, B <: C, C] as Lub2[A, B]:
10+
type Output = C
11+
12+
trait Lub[Union]:
13+
type Output
14+
15+
given [A] as Lub[A]:
16+
type Output = A
17+
18+
given [Left, Right](
19+
using lubLeft: Lub[Right], lubRight: Lub[Right])(
20+
using lub2: Lub2[lubLeft.Output, lubRight.Output])
21+
as Lub[Left | Right]:
22+
type Output = lub2.Output

0 commit comments

Comments
 (0)