Skip to content

Commit

Permalink
Merge pull request #14867 from dotty-staging/regression-tests
Browse files Browse the repository at this point in the history
More regression tests
  • Loading branch information
odersky committed Apr 6, 2022
2 parents 8d3083b + 71cd02b commit 99a31f7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/pos/i10437.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import scala.language.implicitConversions

final class MyClass(name: String) {

final class Fun0(val f: Function0[Any])

object Fun0 {

implicit def function0AsFun0(f: Function0[Any]): Fun0 = new Fun0(f)

}

def apply(f: => Unit): Unit = {
apply(() => f)
}

def apply(fun: Fun0): Unit = {
// Do something
println(s"Got a Fun0 $fun")
}

def apply[T1](f: (T1) => Any)(implicit m1: Manifest[T1]): Unit = {
// Do something
println(s"Got a Function1: ${f}")
}

}
13 changes: 13 additions & 0 deletions tests/run/i9225.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait A {
val s = "same val in A"
def f: String = s
}

class B extends A {
class C {
def call_f_in_A: String = B.super[A].f
}
}
val b = new B
val c = new b.C
@main def Test = c.call_f_in_A // AbstractMethodError

0 comments on commit 99a31f7

Please sign in to comment.