Skip to content

Commit b22cf06

Browse files
Merge pull request #6482 from dotty-staging/fix-#6474
Fix #6474: Add regression test
2 parents 9ed471c + c8c8b3c commit b22cf06

File tree

1 file changed

+22
-0
lines changed
  • compiler/test-resources/repl

1 file changed

+22
-0
lines changed

compiler/test-resources/repl/i6474

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
scala> object Foo1 { type T[+A] = (A, Int) }
2+
// defined object Foo1
3+
scala> object Foo2 { type T[+A] = [+B] => (A, B) }
4+
// defined object Foo2
5+
scala> object Foo3 { type T[+A] = [+B] => [C] => (A, B) }
6+
// defined object Foo3
7+
scala> ((1, 2): Foo1.T[Int]): Foo1.T[Any]
8+
val res0: (Any, Int) = (1,2)
9+
scala> ((1, 2): Foo2.T[Int][Int]): Foo2.T[Any][Int]
10+
val res1: (Any, Int) = (1,2)
11+
scala> (1, 2): Foo3.T[Int][Int]
12+
1 | (1, 2): Foo3.T[Int][Int]
13+
| ^^^^^^^^^^^^^^^^
14+
| Missing type parameter for Foo3.T[Int][Int]
15+
scala> ((1, 2): Foo3.T[Int][Int][Int]): Foo3.T[Any][Int][Int]
16+
val res2: (Any, Int) = (1,2)
17+
scala> object Foo3 { type T[A] = [B] => [C] => (A, B) }
18+
// defined object Foo3
19+
scala> ((1, 2): Foo3.T[Int][Int][Int])
20+
val res3: (Int, Int) = (1,2)
21+
scala> ((1, 2): Foo3.T[Int][Int][Int])
22+
val res4: (Int, Int) = (1,2)

0 commit comments

Comments
 (0)