krissrex
04/01/2017, 12:07 PMmyRef.java.newInstance() or myRef.java.constructors[0].newInstance(true), or the KClass way:
val myRef: KClass<out PromotablePiece> = Queen::class
val constructors: Collection<KFunction<PromotablePiece>> = myRef.constructors
val first: KFunction<PromotablePiece> = constructors.first()
val parameter = first.parameters.find { it.name == "whitePlayer" }!!
val instance: PromotablePiece = first.callBy(mapOf(parameter to true))