@NotNull @Override public Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull Name labelName) { ArrayList<DeclarationDescriptor> result = new ArrayList<DeclarationDescriptor>(); for (JetScope jetScope : scopeChain) { result.addAll(jetScope.getDeclarationsByLabel(labelName)); } result.trimToSize(); return result; }
@NotNull @Override public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() { if (implicitReceiverHierarchy == null) { ArrayList<ReceiverParameterDescriptor> result = new ArrayList<ReceiverParameterDescriptor>(); for (JetScope jetScope : scopeChain) { result.addAll(jetScope.getImplicitReceiversHierarchy()); } result.trimToSize(); implicitReceiverHierarchy = result; } return implicitReceiverHierarchy; }