Do not try computing return type in OverloadChecker
Return type is not needed for checking overloads, but querying it may involve resolving function bodies, which usually happens after overload checking (see LazyTopDownAnalyzer.analyzeDeclarations) and at this point can lead to incorrect BACKING_FIELD_REQUIRED value being computed for some properties (see KT-27895) #KT-27895 Fixed
This commit is contained in:
@@ -55,7 +55,9 @@ class OverloadChecker(val specificityComparator: TypeSpecificityComparator) {
|
||||
// They can be disambiguated by providing explicit type parameters.
|
||||
if (a.typeParameters.isEmpty() != b.typeParameters.isEmpty()) return true
|
||||
|
||||
if (ErrorUtils.containsErrorType(a) || ErrorUtils.containsErrorType(b)) return true
|
||||
if (a is FunctionDescriptor && ErrorUtils.containsErrorTypeInParameters(a) ||
|
||||
b is FunctionDescriptor && ErrorUtils.containsErrorTypeInParameters(b)
|
||||
) return true
|
||||
if (a.varargParameterPosition() != b.varargParameterPosition()) return true
|
||||
|
||||
val aSignature = FlatSignature.createFromCallableDescriptor(a)
|
||||
|
||||
Reference in New Issue
Block a user