blob: 51ccf0a1666877c50262efada023ebeb81f1afc7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
class A {
def foo1[T]: Unit = {}
def foo2[T](): Unit = {}
def foo3[T]()(): Unit = {}
def foo4: Unit = {}
def foo5(): Unit = {}
def foo6()(): Unit = {}
}
object Test {
def main(args: Array[String]): Unit = {
classOf[A].getMethods.toList.filter(_.getName.startsWith("foo")).foreach { m =>
assert(m.getGenericReturnType == Void.TYPE, s"Method does not return void: `${m}`")
}
}
}
|