Allow to turn the first parameter of a SAM-converted lambda into the receiver (KT-12848)

This commit is contained in:
Yan Zhulanow
2016-12-06 20:03:27 +03:00
parent fc8cc217dc
commit cbef0250aa
57 changed files with 935 additions and 148 deletions
@@ -53,7 +53,7 @@ import org.jetbrains.kotlin.utils.toReadOnlyList
import java.util.*
class LazyJavaClassDescriptor(
outerContext: LazyJavaResolverContext,
val outerContext: LazyJavaResolverContext,
containingDeclaration: DeclarationDescriptor,
private val jClass: JavaClass,
private val additionalSupertypeClassDescriptor: ClassDescriptor? = null
@@ -123,10 +123,6 @@ class LazyJavaClassDescriptor(
override val annotations by c.storageManager.createLazyValue { c.resolveAnnotations(jClass) }
private val functionTypeForSamInterface = c.storageManager.createNullableLazyValue {
c.components.samConversionResolver.resolveFunctionTypeIfSamInterface(this)
}
private val declaredParameters = c.storageManager.createLazyValue {
jClass.typeParameters.map {
p ->
@@ -137,7 +133,7 @@ class LazyJavaClassDescriptor(
override fun getDeclaredTypeParameters() = declaredParameters()
override fun getFunctionTypeForSamInterface(): SimpleType? = functionTypeForSamInterface()
override fun getFunctionTypeForSamInterface(): SimpleType? = c.components.samConversionResolver.resolveFunctionTypeIfSamInterface(this)
override fun toString() = "Lazy Java class ${this.fqNameUnsafe}"