diff options
Diffstat (limited to 'test/files/run/t9437a/Test.scala')
-rw-r--r-- | test/files/run/t9437a/Test.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/t9437a/Test.scala b/test/files/run/t9437a/Test.scala new file mode 100644 index 0000000000..a86c17b646 --- /dev/null +++ b/test/files/run/t9437a/Test.scala @@ -0,0 +1,20 @@ +class Foo(a: Int, `_`: String, *** : Long, `unary_!` : Float, ABC: Double) { + def bar(a: Int, `_`: String, *** : Long, `unary_!` : Float, ABC: Double) = null +} + +object Test extends App { + val constrParams = classOf[Foo].getConstructors.head.getParameters + val methodParams = classOf[Foo].getDeclaredMethods.head.getParameters + + def printParams(params: Array[java.lang.reflect.Parameter]) = { + params.foreach { param => + println(s"name: ${param.getName}; isNamePresent: ${param.isNamePresent}; isSynthetic: ${param.isSynthetic}") + } + } + + printParams(constrParams) + printParams(methodParams) + + val foo = new Foo(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0) + foo.bar(a = 1, `_` = "2", *** = 3L, `unary_!` = 4.0f, ABC = 5.0) +} |