Using reflection is it possible to call a private constructor for a class? My attempt to do this results in exception about the modifier being private which makes sense but figured there is some way around this
e
ephemient
01/19/2021, 3:19 AM
Copy code
import kotlin.reflect.jvm.isAccessible
class Foo private constructor()
val constructor = Foo::class.constructors.single()
constructor.isAccessible = true
println(constructor.call())