Skip to content

Instantly share code, notes, and snippets.

@timf
Created January 24, 2012 03:33
Show Gist options
  • Select an option

  • Save timf/1667618 to your computer and use it in GitHub Desktop.

Select an option

Save timf/1667618 to your computer and use it in GitHub Desktop.
scala> case class C(a: String, b: Option[String])
defined class C
scala> val constructors = C("",None).getClass.getConstructors
constructors: Array[java.lang.reflect.Constructor[_]] = Array(public C(java.lang.String,scala.Option))
scala> constructors.length
res13: Int = 1
scala> constructors(0).getParameterTypes
res15: Array[java.lang.Class[_]] = Array(class java.lang.String, class scala.Option)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment