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
@@ -216,8 +216,9 @@ public final class Namer {
// TODO: get rid of this function
@NotNull
private static String getStableMangledNameForDescriptor(@NotNull ClassDescriptor descriptor, @NotNull String functionName) {
Collection<SimpleFunctionDescriptor> functions = descriptor.getDefaultType().getMemberScope().getContributedFunctions(
Name.identifier(functionName), NoLookupLocation.FROM_BACKEND);
Collection<? extends SimpleFunctionDescriptor> functions = descriptor.getDefaultType().getMemberScope().getContributedFunctions(
Name.identifier(functionName), NoLookupLocation.FROM_BACKEND
);
assert functions.size() == 1 : "Can't select a single function: " + functionName + " in " + descriptor;
SuggestedName suggested = new NameSuggestion().suggest(functions.iterator().next());
assert suggested != null : "Suggested name for class members is always non-null: " + functions.iterator().next();
@@ -152,7 +152,7 @@ public final class CallExpressionTranslator extends AbstractCallExpressionTransl
@Nullable
private static VariableDescriptor getVariableByName(@NotNull LexicalScope scope, @NotNull Name name) {
while (true) {
Collection<VariableDescriptor> variables = scope.getContributedVariables(name, NoLookupLocation.FROM_BACKEND);
Collection<? extends VariableDescriptor> variables = scope.getContributedVariables(name, NoLookupLocation.FROM_BACKEND);
if (!variables.isEmpty()) {
return variables.size() == 1 ? variables.iterator().next() : null;
}