Skip to content

Commit 99a31f7

Browse files
authored
Merge pull request #14867 from dotty-staging/regression-tests
More regression tests
2 parents 8d3083b + 71cd02b commit 99a31f7

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

tests/pos/i10437.scala

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import scala.language.implicitConversions
2+
3+
final class MyClass(name: String) {
4+
5+
final class Fun0(val f: Function0[Any])
6+
7+
object Fun0 {
8+
9+
implicit def function0AsFun0(f: Function0[Any]): Fun0 = new Fun0(f)
10+
11+
}
12+
13+
def apply(f: => Unit): Unit = {
14+
apply(() => f)
15+
}
16+
17+
def apply(fun: Fun0): Unit = {
18+
// Do something
19+
println(s"Got a Fun0 $fun")
20+
}
21+
22+
def apply[T1](f: (T1) => Any)(implicit m1: Manifest[T1]): Unit = {
23+
// Do something
24+
println(s"Got a Function1: ${f}")
25+
}
26+
27+
}

tests/run/i9225.scala

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
trait A {
2+
val s = "same val in A"
3+
def f: String = s
4+
}
5+
6+
class B extends A {
7+
class C {
8+
def call_f_in_A: String = B.super[A].f
9+
}
10+
}
11+
val b = new B
12+
val c = new b.C
13+
@main def Test = c.call_f_in_A // AbstractMethodError

0 commit comments

Comments
 (0)