Skip to content

Commit 91f0671

Browse files
committed
Add tests
Adds the original test form #1381. t2660 looks similar. Also adds some unrelated tests I had in the queue that now compile.
1 parent 12ba8af commit 91f0671

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

tests/pos/hkgadt.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
object HKGADT {
2+
sealed trait Foo[F[_]]
3+
final case class Bar() extends Foo[List]
4+
5+
def frob[F[_]](foo: Foo[F]) =
6+
foo match {
7+
case Bar() => ()
8+
}
9+
}

tests/pos/i618.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class C(val f: Any*)
2+
3+
class D(override val f: Nothing) extends C(f)

tests/pos/overloaded.scala

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,30 @@ object overloaded {
5757
val a: A = fr(new C)
5858
val b: B = fr(new C)
5959
}
60+
61+
// from #1381
62+
63+
object Foo {
64+
class Bar[T]
65+
implicit def const[T](x: T): Bar[T] = ???
66+
67+
def bar[T](e: T): Any = ???
68+
def bar[T](e: Bar[T]): Any = ???
69+
70+
val b: Bar[Int] = ???
71+
bar(b)
72+
}
73+
74+
object Test2 {
75+
trait A; trait B
76+
class C1 {
77+
def f(x: A): Unit = println("A")
78+
}
79+
class C2 extends C1 {
80+
def f(x: B): Unit = println("B")
81+
}
82+
object Test extends C2 with App {
83+
implicit def a2b(x: A): B = new B {}
84+
f(new A {})
85+
}
86+
}

0 commit comments

Comments
 (0)