Merge ResolutionFacadeImpl and KotlinResolveCache, rewrite JavaResolveExtension
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.container
|
||||
|
||||
import kotlin.properties.ReadOnlyProperty
|
||||
|
||||
public fun createContainer(id: String, init: StorageComponentContainer.() -> Unit): StorageComponentContainer {
|
||||
val c = StorageComponentContainer(id)
|
||||
c.init()
|
||||
@@ -30,7 +28,12 @@ public inline fun <reified T> StorageComponentContainer.useImpl() {
|
||||
}
|
||||
|
||||
public inline fun <reified T> ComponentProvider.get(): T {
|
||||
return resolve(javaClass<T>())!!.getValue() as T
|
||||
return getService(javaClass<T>())
|
||||
}
|
||||
|
||||
@suppress("UNCHECKED_CAST")
|
||||
public fun <T> ComponentProvider.getService(request: Class<T>): T {
|
||||
return resolve(request)!!.getValue() as T
|
||||
}
|
||||
|
||||
public fun StorageComponentContainer.useInstance(instance: Any) {
|
||||
@@ -38,5 +41,5 @@ public fun StorageComponentContainer.useInstance(instance: Any) {
|
||||
}
|
||||
|
||||
public inline fun <reified T> ComponentProvider.get(thisRef: Any?, desc: PropertyMetadata): T {
|
||||
return resolve(javaClass<T>())!!.getValue() as T
|
||||
return getService(javaClass<T>())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user