Skip to content

Commit 788b264

Browse files
committed
Add punused path dependent tests
currently failing
1 parent 025bc51 commit 788b264

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

tests/pos/unused-pathdep-1.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
object Test {
2+
3+
fun1(new Bar)
4+
fun2(new Bar)
5+
fun3(new Bar)
6+
7+
def fun1[F >: Bar <: Foo](unused f: F): f.X = null.asInstanceOf[f.X]
8+
def fun2[F >: Bar <: Foo](unused f: F)(unused bar: f.B): f.B = null.asInstanceOf[f.B]
9+
def fun3[F >: Bar <: Foo](unused f: F)(unused b: f.B): b.X = null.asInstanceOf[b.X]
10+
}
11+
12+
class Foo {
13+
type X
14+
type B <: Bar
15+
}
16+
17+
class Bar extends Foo {
18+
type X = String
19+
}

tests/pos/unused-pathdep-2.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
object Test {
2+
3+
type F >: Bar <: Foo
4+
5+
unused val f: F = new Bar
6+
7+
type F1 <: f.X
8+
type F2[Z <: f.X]
9+
10+
}
11+
12+
class Foo {
13+
type X
14+
type B <: Bar
15+
}
16+
17+
class Bar extends Foo {
18+
type X = String
19+
}

0 commit comments

Comments
 (0)