Skip to content

Commit 30ed58a

Browse files
committed
Add original test and test with sealed class hierarchy
1 parent 1ecdddc commit 30ed58a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/pos/i12508.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@ class Test {
55
def x: X = ???
66
def foo: Unit = this.x.toString
77
}
8+
}
9+
class Test2 {
10+
inline def test(fun: => Any): Any = fun
11+
test {
12+
case class Pair[X, Y](
13+
x: X,
14+
y: Y,
15+
)
16+
}
817
}

tests/pos/i12508b.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def fun(a: Any, b: Any = 2): Any = ???
2+
def test =
3+
fun(
4+
b = println(1),
5+
a = {
6+
sealed class Foo[X]:
7+
def x: X = ???
8+
def foo: Unit = this.x.toString
9+
class Bar extends Foo[String]
10+
class Baz[Y] extends Foo[Y]
11+
if ??? then Bar() else Baz[Int]
12+
}
13+
)

0 commit comments

Comments
 (0)