KT-8394 ReplaceWith for Delegates.lazy fails outside of stdlib

#KT-8394 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-07-10 21:53:02 +03:00
parent 1346d98bf3
commit d32ba08cb7
20 changed files with 199 additions and 90 deletions
@@ -77,10 +77,10 @@ class LazyJavaClassDescriptor(
private val typeConstructor = c.storageManager.createLazyValue { LazyJavaClassTypeConstructor() }
override fun getTypeConstructor(): TypeConstructor = typeConstructor()
private val scopeForMemberLookup = LazyJavaClassMemberScope(c, this, jClass)
override fun getScopeForMemberLookup() = scopeForMemberLookup
private val unsubstitutedMemberScope = LazyJavaClassMemberScope(c, this, jClass)
override fun getUnsubstitutedMemberScope() = unsubstitutedMemberScope
private val innerClassesScope = InnerClassesScopeWrapper(getScopeForMemberLookup())
private val innerClassesScope = InnerClassesScopeWrapper(getUnsubstitutedMemberScope())
override fun getUnsubstitutedInnerClassesScope(): JetScope = innerClassesScope
private val staticScope = LazyJavaStaticClassScope(c, jClass, this)
@@ -90,14 +90,14 @@ class LazyJavaClassDescriptor(
override fun getCompanionObjectDescriptor(): ClassDescriptor? = null
override fun getConstructors() = scopeForMemberLookup.constructors()
override fun getConstructors() = unsubstitutedMemberScope.constructors()
private val annotations = c.storageManager.createLazyValue { c.resolveAnnotations(jClass) }
override fun getAnnotations() = annotations()
private val functionTypeForSamInterface = c.storageManager.createNullableLazyValue {
c.samConversionResolver.resolveFunctionTypeIfSamInterface(this) { method ->
scopeForMemberLookup.resolveMethodToFunctionDescriptor(method, false)
unsubstitutedMemberScope.resolveMethodToFunctionDescriptor(method, false)
}
}