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:
@@ -142,19 +142,11 @@ public class ErrorUtils {
|
||||
};
|
||||
}
|
||||
|
||||
public static boolean containsErrorType(@NotNull CallableDescriptor callableDescriptor) {
|
||||
if (callableDescriptor instanceof FunctionDescriptor) {
|
||||
return containsErrorType((FunctionDescriptor) callableDescriptor);
|
||||
}
|
||||
else {
|
||||
return containsErrorType(callableDescriptor.getReturnType());
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean containsErrorType(@NotNull FunctionDescriptor function) {
|
||||
if (containsErrorType(function.getReturnType())) {
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* @return true iff any of the types referenced in parameter types (including type parameters and extension receiver) of the function
|
||||
* is an error type. Does not check the return type of the function.
|
||||
*/
|
||||
public static boolean containsErrorTypeInParameters(@NotNull FunctionDescriptor function) {
|
||||
ReceiverParameterDescriptor receiverParameter = function.getExtensionReceiverParameter();
|
||||
if (receiverParameter != null && containsErrorType(receiverParameter.getType())) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user