Make project compilable after fixes about generic nullability
This commit is contained in:
@@ -111,10 +111,10 @@ public fun StorageComponentContainer.registerInstance(instance: Any): StorageCom
|
||||
return registerDescriptors(listOf(InstanceComponentDescriptor(instance)))
|
||||
}
|
||||
|
||||
public inline fun <reified T> StorageComponentContainer.resolve(context: ValueResolveContext = unknownContext): ValueDescriptor? {
|
||||
public inline fun <reified T : Any> StorageComponentContainer.resolve(context: ValueResolveContext = unknownContext): ValueDescriptor? {
|
||||
return resolve(javaClass<T>(), context)
|
||||
}
|
||||
|
||||
public inline fun <reified T> StorageComponentContainer.resolveMultiple(context: ValueResolveContext = unknownContext): Iterable<ValueDescriptor> {
|
||||
public inline fun <reified T : Any> StorageComponentContainer.resolveMultiple(context: ValueResolveContext = unknownContext): Iterable<ValueDescriptor> {
|
||||
return resolveMultiple(javaClass<T>(), context)
|
||||
}
|
||||
|
||||
@@ -23,16 +23,16 @@ public fun createContainer(id: String, init: StorageComponentContainer.() -> Uni
|
||||
return c
|
||||
}
|
||||
|
||||
public inline fun <reified T> StorageComponentContainer.useImpl() {
|
||||
public inline fun <reified T : Any> StorageComponentContainer.useImpl() {
|
||||
registerSingleton(javaClass<T>())
|
||||
}
|
||||
|
||||
public inline fun <reified T> ComponentProvider.get(): T {
|
||||
public inline fun <reified T : Any> ComponentProvider.get(): T {
|
||||
return getService(javaClass<T>())
|
||||
}
|
||||
|
||||
@suppress("UNCHECKED_CAST")
|
||||
public fun <T> ComponentProvider.getService(request: Class<T>): T {
|
||||
public fun <T : Any> ComponentProvider.getService(request: Class<T>): T {
|
||||
return resolve(request)!!.getValue() as T
|
||||
}
|
||||
|
||||
@@ -40,6 +40,6 @@ public fun StorageComponentContainer.useInstance(instance: Any) {
|
||||
registerInstance(instance)
|
||||
}
|
||||
|
||||
public inline fun <reified T> ComponentProvider.get(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
public inline fun <reified T : Any> ComponentProvider.get(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
return getService(javaClass<T>())
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||
import org.jetbrains.kotlin.renderer.Renderer
|
||||
|
||||
public fun <P> renderParameter(parameter: P, renderer: Renderer<P>?): Any = renderer?.render(parameter) ?: parameter
|
||||
public fun <P : Any> renderParameter(parameter: P, renderer: Renderer<P>?): Any = renderer?.render(parameter) ?: parameter
|
||||
|
||||
public fun ClassDescriptor.renderKindWithName(): String = DescriptorRenderer.getClassKindPrefix(this) + " '" + getName() + "'"
|
||||
|
||||
|
||||
+2
-2
@@ -29,10 +29,10 @@ import org.jetbrains.kotlin.psi.JetExpression
|
||||
import org.jetbrains.kotlin.types.JetType
|
||||
|
||||
public class LockBasedLazyResolveStorageManager(private val storageManager: StorageManager): StorageManager by storageManager, LazyResolveStorageManager {
|
||||
override fun <K, V> createSoftlyRetainedMemoizedFunction(compute: Function1<K, V>) =
|
||||
override fun <K, V : Any> createSoftlyRetainedMemoizedFunction(compute: Function1<K, V>) =
|
||||
storageManager.createMemoizedFunction<K, V>(compute, ContainerUtil.createConcurrentSoftValueMap<K, Any>())
|
||||
|
||||
override fun <K, V> createSoftlyRetainedMemoizedFunctionWithNullableValues(compute: Function1<K, V>) =
|
||||
override fun <K, V : Any> createSoftlyRetainedMemoizedFunctionWithNullableValues(compute: Function1<K, V>) =
|
||||
storageManager.createMemoizedFunctionWithNullableValues<K, V>(compute, ContainerUtil.createConcurrentSoftValueMap<K, Any>())
|
||||
|
||||
override fun createSafeTrace(originalTrace: BindingTrace) =
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Services private constructor(private val map: Map<Class<*>, Any>) {
|
||||
|
||||
private val map = HashMap<Class<*>, Any>()
|
||||
|
||||
public fun <T> register(interfaceClass: Class<T>, implementation: T): Builder {
|
||||
public fun <T : Any> register(interfaceClass: Class<T>, implementation: T): Builder {
|
||||
map.put(interfaceClass, implementation)
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public class DescriptorKindFilter(
|
||||
.filterNotNull()
|
||||
.toReadOnlyList()
|
||||
|
||||
private inline fun <reified T> staticFields() = javaClass<T>().getFields().filter { Modifier.isStatic(it.getModifiers()) }
|
||||
private inline fun <reified T : Any> staticFields() = javaClass<T>().getFields().filter { Modifier.isStatic(it.getModifiers()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public inline fun getFromAllScopes<Scope, T>(scopes: Array<out Scope>, callback:
|
||||
return result ?: emptySet()
|
||||
}
|
||||
|
||||
public inline fun getFirstMatch<Scope, T>(scopes: Array<out Scope>, callback: (Scope) -> T): T {
|
||||
public inline fun getFirstMatch<Scope, T : Any>(scopes: Array<out Scope>, callback: (Scope) -> T?): T? {
|
||||
// NOTE: This is performance-sensitive; please don't replace with map().firstOrNull()
|
||||
for (scope in scopes) {
|
||||
val result = callback(scope)
|
||||
|
||||
@@ -43,7 +43,7 @@ public val KClass<*>.declaredFunctions: Collection<KFunction<*>>
|
||||
/**
|
||||
* Returns non-extension properties declared in this class and all of its superclasses.
|
||||
*/
|
||||
public val <T> KClass<T>.memberProperties: Collection<KProperty1<T, *>>
|
||||
public val <T : Any> KClass<T>.memberProperties: Collection<KProperty1<T, *>>
|
||||
get() = (this as KClassImpl<T>)
|
||||
.getMembers(declaredOnly = false, nonExtensions = true, extensions = false)
|
||||
.filterIsInstance<KProperty1<T, *>>()
|
||||
@@ -52,7 +52,7 @@ public val <T> KClass<T>.memberProperties: Collection<KProperty1<T, *>>
|
||||
/**
|
||||
* Returns extension properties declared in this class and all of its superclasses.
|
||||
*/
|
||||
public val <T> KClass<T>.memberExtensionProperties: Collection<KProperty2<T, *, *>>
|
||||
public val <T : Any> KClass<T>.memberExtensionProperties: Collection<KProperty2<T, *, *>>
|
||||
get() = (this as KClassImpl<T>)
|
||||
.getMembers(declaredOnly = false, nonExtensions = false, extensions = true)
|
||||
.filterIsInstance<KProperty2<T, *, *>>()
|
||||
@@ -61,7 +61,7 @@ public val <T> KClass<T>.memberExtensionProperties: Collection<KProperty2<T, *,
|
||||
/**
|
||||
* Returns non-extension properties declared in this class.
|
||||
*/
|
||||
public val <T> KClass<T>.declaredMemberProperties: Collection<KProperty1<T, *>>
|
||||
public val <T : Any> KClass<T>.declaredMemberProperties: Collection<KProperty1<T, *>>
|
||||
get() = (this as KClassImpl<T>)
|
||||
.getMembers(declaredOnly = true, nonExtensions = true, extensions = false)
|
||||
.filterIsInstance<KProperty1<T, *>>()
|
||||
@@ -70,7 +70,7 @@ public val <T> KClass<T>.declaredMemberProperties: Collection<KProperty1<T, *>>
|
||||
/**
|
||||
* Returns extension properties declared in this class.
|
||||
*/
|
||||
public val <T> KClass<T>.declaredMemberExtensionProperties: Collection<KProperty2<T, *, *>>
|
||||
public val <T : Any> KClass<T>.declaredMemberExtensionProperties: Collection<KProperty2<T, *, *>>
|
||||
get() = (this as KClassImpl<T>)
|
||||
.getMembers(declaredOnly = true, nonExtensions = false, extensions = true)
|
||||
.filterIsInstance<KProperty2<T, *, *>>()
|
||||
|
||||
@@ -25,19 +25,19 @@ public val Field.kotlin: KProperty<*>?
|
||||
|
||||
|
||||
@deprecated("Use memberProperties instead.", ReplaceWith("memberProperties"))
|
||||
public val <T> KClass<T>.properties: Collection<KProperty1<T, *>>
|
||||
public val <T : Any> KClass<T>.properties: Collection<KProperty1<T, *>>
|
||||
get() = memberProperties
|
||||
|
||||
@deprecated("Use extensionProperties instead.", ReplaceWith("extensionProperties"))
|
||||
public val <T> KClass<T>.extensionProperties: Collection<KProperty2<T, *, *>>
|
||||
public val <T : Any> KClass<T>.extensionProperties: Collection<KProperty2<T, *, *>>
|
||||
get() = memberExtensionProperties
|
||||
|
||||
@deprecated("Use declaredMemberProperties instead.", ReplaceWith("declaredMemberProperties"))
|
||||
public val <T> KClass<T>.declaredProperties: Collection<KProperty1<T, *>>
|
||||
public val <T : Any> KClass<T>.declaredProperties: Collection<KProperty1<T, *>>
|
||||
get() = declaredMemberProperties
|
||||
|
||||
@deprecated("Use declaredMemberExtensionProperties instead.", ReplaceWith("declaredMemberExtensionProperties"))
|
||||
public val <T> KClass<T>.declaredExtensionProperties: Collection<KProperty2<T, *, *>>
|
||||
public val <T : Any> KClass<T>.declaredExtensionProperties: Collection<KProperty2<T, *, *>>
|
||||
get() = declaredMemberExtensionProperties
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ public var KProperty<*>.accessible: Boolean
|
||||
|
||||
|
||||
@deprecated("Use .java instead.", ReplaceWith("java"))
|
||||
public val <T> KClass<T>.__java: Class<T>
|
||||
public val <T : Any> KClass<T>.__java: Class<T>
|
||||
@jvmName("getJava")
|
||||
get() = this.java
|
||||
|
||||
@deprecated("Use .kotlin instead.", ReplaceWith("kotlin"))
|
||||
public val <T> Class<T>.__kotlin: KClass<T>
|
||||
public val <T : Any> Class<T>.__kotlin: KClass<T>
|
||||
@jvmName("getKotlin")
|
||||
get() = this.kotlin
|
||||
|
||||
@@ -27,7 +27,7 @@ import kotlin.reflect.jvm.internal.pcollections.HashPMap
|
||||
private var FOREIGN_K_CLASSES = HashPMap.empty<String, Any>()
|
||||
|
||||
// This function is invoked on each reflection access to Java classes, properties, etc. Performance is critical here.
|
||||
fun <T> foreignKotlinClass(jClass: Class<T>): KClassImpl<T> {
|
||||
fun <T : Any> foreignKotlinClass(jClass: Class<T>): KClassImpl<T> {
|
||||
val name = jClass.getName()
|
||||
val cached = FOREIGN_K_CLASSES[name]
|
||||
if (cached is WeakReference<*>) {
|
||||
|
||||
@@ -131,7 +131,7 @@ public val Method.kotlinFunction: KFunction<*>?
|
||||
* or `null` if this constructor cannot be represented by a Kotlin function
|
||||
* (for example, if it is a synthetic constructor).
|
||||
*/
|
||||
public val <T> Constructor<T>.kotlinFunction: KFunction<T>?
|
||||
public val <T : Any> Constructor<T>.kotlinFunction: KFunction<T>?
|
||||
get() {
|
||||
if (isSynthetic()) return null
|
||||
|
||||
|
||||
@@ -32,4 +32,4 @@ public interface NullableLazyValue<T : Any> : Function0<T?> {
|
||||
public fun isComputed(): Boolean
|
||||
}
|
||||
|
||||
public fun <T> NotNullLazyValue<T>.get(_this: Any?, p: PropertyMetadata): T = invoke()
|
||||
public fun <T : Any> NotNullLazyValue<T>.get(_this: Any?, p: PropertyMetadata): T = invoke()
|
||||
|
||||
@@ -68,7 +68,7 @@ abstract class AbstractValueBase<V>(
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return value.hashCode() + 17 * asmType.hashCode()
|
||||
return value!!.hashCode() + 17 * asmType.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,19 +38,19 @@ public interface ResolutionFacade {
|
||||
public val moduleDescriptor: ModuleDescriptor
|
||||
|
||||
// get service for the module this resolution was created for
|
||||
public fun <T> getFrontendService(serviceClass: Class<T>): T
|
||||
public fun <T : Any> getFrontendService(serviceClass: Class<T>): T
|
||||
|
||||
public fun <T> getIdeService(serviceClass: Class<T>): T
|
||||
public fun <T : Any> getIdeService(serviceClass: Class<T>): T
|
||||
|
||||
// get service for the module defined by PsiElement/ModuleDescriptor passed as parameter
|
||||
public fun <T> getFrontendService(element: PsiElement, serviceClass: Class<T>): T
|
||||
public fun <T : Any> getFrontendService(element: PsiElement, serviceClass: Class<T>): T
|
||||
|
||||
public fun <T> getFrontendService(moduleDescriptor: ModuleDescriptor, serviceClass: Class<T>): T
|
||||
public fun <T : Any> getFrontendService(moduleDescriptor: ModuleDescriptor, serviceClass: Class<T>): T
|
||||
|
||||
}
|
||||
|
||||
public inline fun <reified T> ResolutionFacade.frontendService(): T
|
||||
public inline fun <reified T : Any> ResolutionFacade.frontendService(): T
|
||||
= this.getFrontendService(javaClass<T>())
|
||||
|
||||
public inline fun <reified T> ResolutionFacade.ideService(): T
|
||||
public inline fun <reified T : Any> ResolutionFacade.ideService(): T
|
||||
= this.getIdeService(javaClass<T>())
|
||||
+1
-1
@@ -77,7 +77,7 @@ public class KotlinCacheService(val project: Project) {
|
||||
}
|
||||
|
||||
deprecated("Use JetElement.getResolutionFacade(), please avoid introducing new usages")
|
||||
public fun <T> getProjectService(platform: TargetPlatform, ideaModuleInfo: IdeaModuleInfo, serviceClass: Class<T>): T {
|
||||
public fun <T : Any> getProjectService(platform: TargetPlatform, ideaModuleInfo: IdeaModuleInfo, serviceClass: Class<T>): T {
|
||||
return globalFacade(platform).resolverForModuleInfo(ideaModuleInfo).componentProvider.getService(serviceClass)
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -110,21 +110,21 @@ private class ResolutionFacadeImpl(
|
||||
return resolveSession.resolveToDescriptor(declaration)
|
||||
}
|
||||
|
||||
override fun <T> getFrontendService(serviceClass: Class<T>): T = getFrontendService(moduleInfo, serviceClass)
|
||||
override fun <T : Any> getFrontendService(serviceClass: Class<T>): T = getFrontendService(moduleInfo, serviceClass)
|
||||
|
||||
override fun <T> getIdeService(serviceClass: Class<T>): T {
|
||||
override fun <T : Any> getIdeService(serviceClass: Class<T>): T {
|
||||
return projectFacade.resolverForModuleInfo(moduleInfo).componentProvider.create(serviceClass)
|
||||
}
|
||||
|
||||
override fun <T> getFrontendService(element: PsiElement, serviceClass: Class<T>): T {
|
||||
override fun <T : Any> getFrontendService(element: PsiElement, serviceClass: Class<T>): T {
|
||||
return getFrontendService(element.getModuleInfo(), serviceClass)
|
||||
}
|
||||
|
||||
fun <T> getFrontendService(ideaModuleInfo: IdeaModuleInfo, serviceClass: Class<T>): T {
|
||||
fun <T : Any> getFrontendService(ideaModuleInfo: IdeaModuleInfo, serviceClass: Class<T>): T {
|
||||
return projectFacade.resolverForModuleInfo(ideaModuleInfo).componentProvider.getService(serviceClass)
|
||||
}
|
||||
|
||||
override fun <T> getFrontendService(moduleDescriptor: ModuleDescriptor, serviceClass: Class<T>): T {
|
||||
override fun <T : Any> getFrontendService(moduleDescriptor: ModuleDescriptor, serviceClass: Class<T>): T {
|
||||
return projectFacade.resolverForDescriptor(moduleDescriptor).componentProvider.getService(serviceClass)
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public abstract class JetWholeProjectModalByCollectionAction<TTask : Any>(modalT
|
||||
abstract fun collectTasksForFile(project: Project, file: JetFile, accumulator: MutableCollection<TTask>)
|
||||
}
|
||||
|
||||
class JetWholeProjectForEachElementOfTypeFix<TTask> private constructor(
|
||||
class JetWholeProjectForEachElementOfTypeFix<TTask : Any> private constructor(
|
||||
private val collectingVisitorFactory: (MutableCollection<TTask>) -> JetVisitorVoid,
|
||||
private val tasksProcessor: (Collection<TTask>) -> Unit,
|
||||
private val name: String,
|
||||
@@ -148,7 +148,7 @@ class JetWholeProjectForEachElementOfTypeFix<TTask> private constructor(
|
||||
name = name
|
||||
)
|
||||
|
||||
inline fun <reified TElement : JetElement, TTask> createForMultiTaskOnElement(
|
||||
inline fun <reified TElement : JetElement, TTask : Any> createForMultiTaskOnElement(
|
||||
noinline tasksFactory: (TElement) -> Collection<TTask>,
|
||||
noinline tasksProcessor: (Collection<TTask>) -> Unit,
|
||||
name: String
|
||||
|
||||
+4
-4
@@ -29,22 +29,22 @@ import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.utils.singletonOrEmptyList
|
||||
|
||||
public abstract class CreateFromUsageFactory<E : JetElement, D> : JetIntentionActionsFactory() {
|
||||
public abstract class CreateFromUsageFactory<E : JetElement, D : Any> : JetIntentionActionsFactory() {
|
||||
protected abstract fun getElementOfInterest(diagnostic: Diagnostic): E?
|
||||
|
||||
protected open fun createQuickFix(
|
||||
originalElementPointer: SmartPsiElementPointer<E>,
|
||||
diagnostic: Diagnostic,
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> D
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> D?
|
||||
): QuickFixWithDelegateFactory? = null
|
||||
|
||||
protected open fun createQuickFixes(
|
||||
originalElementPointer: SmartPsiElementPointer<E>,
|
||||
diagnostic: Diagnostic,
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> D
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> D?
|
||||
): List<QuickFixWithDelegateFactory> = createQuickFix(originalElementPointer, diagnostic, quickFixDataFactory).singletonOrEmptyList()
|
||||
|
||||
protected abstract fun createQuickFixData(element: E, diagnostic: Diagnostic): D
|
||||
protected abstract fun createQuickFixData(element: E, diagnostic: Diagnostic): D?
|
||||
|
||||
override final fun doCreateActions(diagnostic: Diagnostic): List<IntentionAction>? {
|
||||
val diagnosticMessage = DefaultErrorMessages.render(diagnostic)
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ public abstract class CreateCallableMemberFromUsageFactory<E : JetElement>(
|
||||
) : CreateFromUsageFactory<E, List<CallableInfo>>() {
|
||||
private fun newCallableQuickFix(
|
||||
originalElementPointer: SmartPsiElementPointer<E>,
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> List<CallableInfo>,
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> List<CallableInfo>?,
|
||||
quickFixFactory: (E, List<CallableInfo>) -> CreateCallableFromUsageFixBase<E>
|
||||
): QuickFixWithDelegateFactory {
|
||||
return QuickFixWithDelegateFactory {
|
||||
@@ -48,7 +48,7 @@ public abstract class CreateCallableMemberFromUsageFactory<E : JetElement>(
|
||||
override fun createQuickFixes(
|
||||
originalElementPointer: SmartPsiElementPointer<E>,
|
||||
diagnostic: Diagnostic,
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> List<CallableInfo>
|
||||
quickFixDataFactory: (SmartPsiElementPointer<E>) -> List<CallableInfo>?
|
||||
): List<QuickFixWithDelegateFactory> {
|
||||
val memberFix = newCallableQuickFix(originalElementPointer, quickFixDataFactory) { element, data ->
|
||||
CreateCallableFromUsageFix(element, data)
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.psi.JetUserType
|
||||
|
||||
abstract class CreateClassFromUsageFactory<E : JetElement>(
|
||||
val createPackageIsAvailable: Boolean = false
|
||||
) : CreateFromUsageFactory<E, ClassInfo?>() {
|
||||
) : CreateFromUsageFactory<E, ClassInfo>() {
|
||||
protected abstract fun getPossibleClassKinds(element: E, diagnostic: Diagnostic): List<ClassKind>
|
||||
|
||||
override fun createQuickFixes(
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ data class CreateParameterData<E : JetElement>(
|
||||
val originalExpression: E
|
||||
)
|
||||
|
||||
abstract class CreateParameterFromUsageFactory<E : JetElement>: CreateFromUsageFactory<E, CreateParameterData<E>?>() {
|
||||
abstract class CreateParameterFromUsageFactory<E : JetElement>: CreateFromUsageFactory<E, CreateParameterData<E>>() {
|
||||
override fun createQuickFix(
|
||||
originalElementPointer: SmartPsiElementPointer<E>,
|
||||
diagnostic: Diagnostic,
|
||||
|
||||
@@ -414,7 +414,7 @@ private fun JsNode.match(predicate: (JsNode) -> Boolean): Set<JsNode> {
|
||||
val visitor = object : JsExpressionVisitor() {
|
||||
val matched = IdentitySet<JsNode>()
|
||||
|
||||
override fun <R : JsNode?> doTraverse(node: R, ctx: JsContext<*>?) {
|
||||
override fun <R : JsNode> doTraverse(node: R, ctx: JsContext<*>?) {
|
||||
super.doTraverse(node, ctx)
|
||||
|
||||
if (node !in matched && predicate(node)) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public fun <T> sequenceOf(vararg elements: T): Sequence<T> = if (elements.isEmpt
|
||||
/**
|
||||
* Creates a sequence that returns all values in the specified [progression].
|
||||
*/
|
||||
public fun <T> sequenceOf(progression: Progression<T>): Sequence<T> = object : Sequence<T> {
|
||||
public fun <T : Any> sequenceOf(progression: Progression<T>): Sequence<T> = object : Sequence<T> {
|
||||
override fun iterator(): Iterator<T> = progression.iterator()
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ import kotlin.reflect.KClass
|
||||
* Returns a Java [Class] instance corresponding to the given [KClass] instance.
|
||||
*/
|
||||
@Intrinsic("kotlin.KClass.java.property")
|
||||
public val <T> KClass<T>.java: Class<T>
|
||||
public val <T : Any> KClass<T>.java: Class<T>
|
||||
get() = (this as ClassBasedDeclarationContainer).jClass as Class<T>
|
||||
|
||||
/**
|
||||
* Returns a [KClass] instance corresponding to the given Java [Class] instance.
|
||||
*/
|
||||
public val <T> Class<T>.kotlin: KClass<T>
|
||||
public val <T : Any> Class<T>.kotlin: KClass<T>
|
||||
get() = Reflection.createKotlinClass(this) as KClass<T>
|
||||
|
||||
Reference in New Issue
Block a user