Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created May 21, 2019 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/0b9b8a3cce76cd077af4c0b948078d7d to your computer and use it in GitHub Desktop.
Save xuwei-k/0b9b8a3cce76cd077af4c0b948078d7d to your computer and use it in GitHub Desktop.
object A {
trait B {
case class C(a1: Int, a2: Option[Int])
}
object D extends B
}
object Main {
def main(args: Array[String]): Unit = {
println(scala.util.Properties.versionString)
val c = classOf[A.D.C].getConstructors.head
println(c.getGenericParameterTypes.toList)
println(c.getParameters.toList)
// 2.13.0-RC1, 2.12.8
// List(interface A$B, int, scala.Option<java.lang.Object>)
// List(final A$B $outer, final A$B a1, final int a2)
// 2.13.0-RC2
// List(int, scala.Option<java.lang.Object>)
// List(final A$B $outer, final int a1, final scala.Option<java.lang.Object> a2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment