Use JvmWildcard on return type of getContributedVariables/getContributedFunctions

This commit is contained in:
Alexander Udalov
2018-07-07 12:38:48 +02:00
parent 9dc53c38f3
commit 23c210e9f2
15 changed files with 53 additions and 63 deletions
@@ -1187,8 +1187,9 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
KotlinType refinedType = KotlinBuiltIns.isNothingOrNullableNothing(receiver.getType()) ?
components.builtIns.getNullableAnyType() :
receiver.getType();
Collection<SimpleFunctionDescriptor> equalsMembers = refinedType.getMemberScope().getContributedFunctions(
OperatorNameConventions.EQUALS, new KotlinLookupLocation(expression.getOperationReference()));
Collection<? extends SimpleFunctionDescriptor> equalsMembers = refinedType.getMemberScope().getContributedFunctions(
OperatorNameConventions.EQUALS, new KotlinLookupLocation(expression.getOperationReference())
);
return CollectionsKt.filter(equalsMembers, descriptor -> {
if (ErrorUtils.isError(descriptor)) return true;
@@ -99,8 +99,9 @@ public class DataFlowAnalyzer {
}
private boolean typeHasOverriddenEquals(@NotNull KotlinType type, @NotNull KtElement lookupElement) {
Collection<SimpleFunctionDescriptor> members = type.getMemberScope().getContributedFunctions(
OperatorNameConventions.EQUALS, new KotlinLookupLocation(lookupElement));
Collection<? extends SimpleFunctionDescriptor> members = type.getMemberScope().getContributedFunctions(
OperatorNameConventions.EQUALS, new KotlinLookupLocation(lookupElement)
);
for (FunctionDescriptor member : members) {
KotlinType returnType = member.getReturnType();
if (returnType == null || !KotlinBuiltIns.isBoolean(returnType)) continue;