ClassDescriptor.getConstructor returns Collection
This commit is contained in:
@@ -24,6 +24,7 @@ import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeProjection;
|
||||
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -39,7 +40,7 @@ public interface ClassDescriptor extends ClassifierDescriptor, MemberDescriptor,
|
||||
JetScope getUnsubstitutedInnerClassesScope();
|
||||
|
||||
@NotNull
|
||||
Set<ConstructorDescriptor> getConstructors();
|
||||
Collection<ConstructorDescriptor> getConstructors();
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ClassDescriptorImpl extends DeclarationDescriptorImpl implements Cl
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<ConstructorDescriptor> getConstructors() {
|
||||
public Collection<ConstructorDescriptor> getConstructors() {
|
||||
return constructors;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -113,8 +113,8 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<ConstructorDescriptor> getConstructors() {
|
||||
Set<ConstructorDescriptor> r = Sets.newHashSet();
|
||||
public Collection<ConstructorDescriptor> getConstructors() {
|
||||
Collection<ConstructorDescriptor> r = Lists.newArrayList();
|
||||
for (ConstructorDescriptor constructor : original.getConstructors()) {
|
||||
r.add((ConstructorDescriptor) constructor.substitute(getSubstitutor()));
|
||||
}
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ public class MutableClassDescriptorLite extends ClassDescriptorBase
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<ConstructorDescriptor> getConstructors() {
|
||||
public Collection<ConstructorDescriptor> getConstructors() {
|
||||
return constructors;
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ public class CallResolver {
|
||||
DeclarationDescriptor declarationDescriptor = constructedType.getConstructor().getDeclarationDescriptor();
|
||||
if (declarationDescriptor instanceof ClassDescriptor) {
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) declarationDescriptor;
|
||||
Set<ConstructorDescriptor> constructors = classDescriptor.getConstructors();
|
||||
Collection<ConstructorDescriptor> constructors = classDescriptor.getConstructors();
|
||||
if (constructors.isEmpty()) {
|
||||
context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn));
|
||||
return checkArgumentTypesAndFail(context);
|
||||
@@ -213,7 +213,7 @@ public class CallResolver {
|
||||
assert containingDeclaration instanceof ClassDescriptor;
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) containingDeclaration;
|
||||
|
||||
Set<ConstructorDescriptor> constructors = classDescriptor.getConstructors();
|
||||
Collection<ConstructorDescriptor> constructors = classDescriptor.getConstructors();
|
||||
if (constructors.isEmpty()) {
|
||||
context.trace.report(NO_CONSTRUCTOR.on(reportAbsenceOn));
|
||||
return checkArgumentTypesAndFail(context);
|
||||
|
||||
@@ -136,7 +136,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<ConstructorDescriptor> getConstructors() {
|
||||
public Collection<ConstructorDescriptor> getConstructors() {
|
||||
return unsubstitutedMemberScope.getConstructors();
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class ErrorUtils {
|
||||
private static final ClassDescriptorImpl ERROR_CLASS = new ClassDescriptorImpl(ERROR_MODULE, Collections.<AnnotationDescriptor>emptyList(), Name.special("<ERROR CLASS>")) {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<ConstructorDescriptor> getConstructors() {
|
||||
public Collection<ConstructorDescriptor> getConstructors() {
|
||||
return ERROR_CONSTRUCTOR_GROUP;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user