Corrected util method getFunctionTypeForSamType for flexible types.
This commit is contained in:
+3
-3
@@ -21,18 +21,18 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor
|
||||
import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptor
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.SimpleType
|
||||
|
||||
interface SamConversionResolver {
|
||||
companion object EMPTY : SamConversionResolver {
|
||||
override fun <D : FunctionDescriptor> resolveSamAdapter(original: D) = null
|
||||
override fun resolveSamConstructor(constructorOwner: DeclarationDescriptor, classifier: () -> ClassifierDescriptor?) = null
|
||||
override fun resolveFunctionTypeIfSamInterface(classDescriptor: JavaClassDescriptor): KotlinType? = null
|
||||
override fun resolveFunctionTypeIfSamInterface(classDescriptor: JavaClassDescriptor): SimpleType? = null
|
||||
}
|
||||
|
||||
fun resolveSamConstructor(constructorOwner: DeclarationDescriptor, classifier: () -> ClassifierDescriptor?): SamConstructorDescriptor?
|
||||
|
||||
fun <D : FunctionDescriptor> resolveSamAdapter(original: D): D?
|
||||
|
||||
fun resolveFunctionTypeIfSamInterface(classDescriptor: JavaClassDescriptor): KotlinType?
|
||||
fun resolveFunctionTypeIfSamInterface(classDescriptor: JavaClassDescriptor): SimpleType?
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,9 +18,9 @@ package org.jetbrains.kotlin.load.java.descriptors;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.SimpleType;
|
||||
|
||||
public interface JavaClassDescriptor extends ClassDescriptor {
|
||||
@Nullable
|
||||
KotlinType getFunctionTypeForSamInterface();
|
||||
SimpleType getFunctionTypeForSamInterface();
|
||||
}
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ class LazyJavaClassDescriptor(
|
||||
|
||||
override fun getDeclaredTypeParameters() = declaredParameters()
|
||||
|
||||
override fun getFunctionTypeForSamInterface(): KotlinType? = functionTypeForSamInterface()
|
||||
override fun getFunctionTypeForSamInterface(): SimpleType? = functionTypeForSamInterface()
|
||||
|
||||
override fun isCompanionObject() = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user