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