Make property java available on KClass<T> where T is type parameter without upper bounds.

This commit is contained in:
Stanislav Erokhin
2017-01-26 01:37:09 +03:00
parent bd47337be2
commit 2aa2df75ae
6 changed files with 66 additions and 3 deletions
@@ -33,7 +33,8 @@ import java.lang.Short as JavaLangShort
/**
* Returns a Java [Class] instance corresponding to the given [KClass] instance.
*/
public val <T : Any> KClass<T>.java: Class<T>
@Suppress("UPPER_BOUND_VIOLATED")
public val <T> KClass<T>.java: Class<T>
@JvmName("getJavaClass")
get() = (this as ClassBasedDeclarationContainer).jClass as Class<T>