src/Pure/General/untyped.scala
changeset 72973 fc69884a6e5a
parent 64370 865b39487b5d
child 73337 0af9e7e4476f
--- a/src/Pure/General/untyped.scala	Mon Dec 21 14:03:12 2020 +0100
+++ b/src/Pure/General/untyped.scala	Mon Dec 21 21:53:12 2020 +0100
@@ -7,11 +7,18 @@
 package isabelle
 
 
-import java.lang.reflect.{Method, Field}
+import java.lang.reflect.{Constructor, Method, Field}
 
 
 object Untyped
 {
+  def constructor[C](c: Class[C], arg_types: Class[_]*): Constructor[C] =
+  {
+    val con = c.getDeclaredConstructor(arg_types: _*)
+    con.setAccessible(true)
+    con
+  }
+
   def method(c: Class[_], name: String, arg_types: Class[_]*): Method =
   {
     val m = c.getDeclaredMethod(name, arg_types: _*)