Fix compiler exception during resolution of ambiguous callable references

Function return type can't and should not be used during overload resolution of callable references.
Since it can be DeferredType, its substitution in CS caused exception.
This commit is contained in:
Pavel Kirpichenkov
2019-10-17 18:33:38 +03:00
parent 8b97819c04
commit 138d558f6a
7 changed files with 78 additions and 3 deletions
@@ -16,8 +16,8 @@
package org.jetbrains.kotlin.resolve.calls.results
import org.jetbrains.kotlin.builtins.getAllParameterProjectionsFromCallableReflectionType
import org.jetbrains.kotlin.container.DefaultImplementation
import org.jetbrains.kotlin.container.PlatformExtensionsClashResolver
import org.jetbrains.kotlin.container.PlatformSpecificExtension
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.MemberDescriptor
@@ -62,7 +62,7 @@ class FlatSignature<out T> constructor(
return FlatSignature(
origin,
descriptor.typeParameters,
reflectionType.arguments.map { it.type }, // should we drop return type?
reflectionType.getAllParameterProjectionsFromCallableReflectionType().map { it.type },
hasExtensionReceiver = false,
hasVarargs = descriptor.valueParameters.any { it.varargElementType != null },
numDefaults = numDefaults,