JetScope.get* return Collection, not Set
This commit is contained in:
@@ -35,6 +35,7 @@ import org.junit.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -53,7 +54,7 @@ public class JavaDescriptorResolverTest extends TestCaseWithTmpdir {
|
||||
public void testStaticFinal() throws Exception {
|
||||
JavaDescriptorResolver javaDescriptorResolver = compileFileGetJavaDescriptorResolver("staticFinal.java");
|
||||
NamespaceDescriptor ns = javaDescriptorResolver.resolveNamespace(new FqName("StaticFinal"), DescriptorSearchRule.ERROR_IF_FOUND_IN_KOTLIN);
|
||||
Set<VariableDescriptor> foos = ns.getMemberScope().getProperties(Name.identifier("foo"));
|
||||
Collection<VariableDescriptor> foos = ns.getMemberScope().getProperties(Name.identifier("foo"));
|
||||
Assert.assertEquals(1, foos.size());
|
||||
VariableDescriptor foo = foos.iterator().next();
|
||||
Assert.assertFalse(foo.getType().isNullable());
|
||||
|
||||
@@ -144,8 +144,8 @@ public class NamespaceComparator {
|
||||
}
|
||||
|
||||
for (Name name : sorted(propertyNames)) {
|
||||
Set<VariableDescriptor> pa = nsa.getMemberScope().getProperties(name);
|
||||
Set<VariableDescriptor> pb = nsb.getMemberScope().getProperties(name);
|
||||
Collection<VariableDescriptor> pa = nsa.getMemberScope().getProperties(name);
|
||||
Collection<VariableDescriptor> pb = nsb.getMemberScope().getProperties(name);
|
||||
compareDeclarationSets("Properties in package " + nsa, pa, pb, sb);
|
||||
|
||||
Assert.assertTrue(nsb.getMemberScope().getFunctions(Name.identifier(PropertyCodegen.getterName(name))).isEmpty());
|
||||
@@ -153,8 +153,8 @@ public class NamespaceComparator {
|
||||
}
|
||||
|
||||
for (Name name : sorted(functionNames)) {
|
||||
Set<FunctionDescriptor> fa = nsa.getMemberScope().getFunctions(name);
|
||||
Set<FunctionDescriptor> fb = nsb.getMemberScope().getFunctions(name);
|
||||
Collection<FunctionDescriptor> fa = nsa.getMemberScope().getFunctions(name);
|
||||
Collection<FunctionDescriptor> fb = nsb.getMemberScope().getFunctions(name);
|
||||
compareDeclarationSets("Functions in package " + nsa, fa, fb, sb);
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@ public class NamespaceComparator {
|
||||
}
|
||||
|
||||
private static void compareDeclarationSets(String message,
|
||||
Set<? extends DeclarationDescriptor> a,
|
||||
Set<? extends DeclarationDescriptor> b,
|
||||
Collection<? extends DeclarationDescriptor> a,
|
||||
Collection<? extends DeclarationDescriptor> b,
|
||||
@NotNull StringBuilder sb) {
|
||||
String at = serializedDeclarationSets(a);
|
||||
String bt = serializedDeclarationSets(b);
|
||||
|
||||
@@ -672,7 +672,7 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<FunctionDescriptor> getFunctions(@NotNull Name name) {
|
||||
public Collection<FunctionDescriptor> getFunctions(@NotNull Name name) {
|
||||
Set<FunctionDescriptor> writableFunctionGroup = Sets.newLinkedHashSet();
|
||||
for (String funDecl : FUNCTION_DECLARATIONS) {
|
||||
FunctionDescriptor functionDescriptor = descriptorResolver.resolveFunctionDescriptor(this.getContainingDeclaration(), this, JetPsiFactory.createFunction(getProject(), funDecl), JetTestUtils.DUMMY_TRACE);
|
||||
|
||||
Reference in New Issue
Block a user