Pass SamConversionResolver explicitly cause it should be call site module-local

This commit is contained in:
Yan Zhulanow
2017-08-09 16:47:28 +03:00
committed by Pavel V. Talanov
parent f0f6a252a5
commit 6f180416b1
8 changed files with 69 additions and 41 deletions
@@ -21,8 +21,9 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import org.jetbrains.kotlin.types.SimpleType;
public interface JavaClassDescriptor extends ClassDescriptor {
// Use SingleAbstractMethodUtils.getFunctionTypeForSamInterface() where possible. This is only a fallback
@Nullable
SimpleType getFunctionTypeForSamInterface();
SimpleType getDefaultFunctionTypeForSamInterface();
/**
* May return false even in case when the class is not SAM interface, but returns true only if it's definitely not a SAM.
@@ -135,7 +135,7 @@ class LazyJavaClassDescriptor(
override fun getDeclaredTypeParameters() = declaredParameters()
override fun getFunctionTypeForSamInterface(): SimpleType? = c.components.samConversionResolver.resolveFunctionTypeIfSamInterface(this)
override fun getDefaultFunctionTypeForSamInterface(): SimpleType? = c.components.samConversionResolver.resolveFunctionTypeIfSamInterface(this)
override fun isDefinitelyNotSamInterface(): Boolean {
if (kind != ClassKind.INTERFACE) return true