Use JvmWildcard on return type of getContributedVariables/getContributedFunctions
This commit is contained in:
@@ -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();
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user