package kotlin.reflect.jvm.internal.impl.resolve.scopes;

import com.google.android.gms.measurement.api.AppMeasurementSdk;
import defpackage.cr4;
import defpackage.ik2;
import defpackage.kp6;
import defpackage.pq6;
import defpackage.sq3;
import defpackage.vx8;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.ClassifierDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.ClassifierDescriptorWithTypeParameters;
import kotlin.reflect.jvm.internal.impl.descriptors.DeclarationDescriptor;
import kotlin.reflect.jvm.internal.impl.descriptors.TypeAliasDescriptor;
import kotlin.reflect.jvm.internal.impl.incremental.components.LookupLocation;
import kotlin.reflect.jvm.internal.impl.name.Name;

/* JADX INFO: loaded from: classes3.dex */
@vx8
public final class InnerClassesScopeWrapper extends MemberScopeImpl {

    @kp6
    private final MemberScope workerScope;

    public InnerClassesScopeWrapper(@kp6 MemberScope memberScope) {
        cr4.g(memberScope, "workerScope");
        this.workerScope = memberScope;
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope
    @pq6
    public Set<Name> getClassifierNames() {
        return this.workerScope.getClassifierNames();
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope
    @pq6
    /* JADX INFO: renamed from: getContributedClassifier */
    public ClassifierDescriptor mo172getContributedClassifier(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        cr4.g(lookupLocation, "location");
        ClassifierDescriptor classifierDescriptorMo172getContributedClassifier = this.workerScope.mo172getContributedClassifier(name, lookupLocation);
        if (classifierDescriptorMo172getContributedClassifier != null) {
            ClassDescriptor classDescriptor = classifierDescriptorMo172getContributedClassifier instanceof ClassDescriptor ? (ClassDescriptor) classifierDescriptorMo172getContributedClassifier : null;
            if (classDescriptor != null) {
                return classDescriptor;
            }
            if (classifierDescriptorMo172getContributedClassifier instanceof TypeAliasDescriptor) {
                return (TypeAliasDescriptor) classifierDescriptorMo172getContributedClassifier;
            }
        }
        return null;
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope
    public /* bridge */ /* synthetic */ Collection getContributedDescriptors(DescriptorKindFilter descriptorKindFilter, sq3 sq3Var) {
        return getContributedDescriptors(descriptorKindFilter, (sq3<? super Name, Boolean>) sq3Var);
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope
    @kp6
    public Set<Name> getFunctionNames() {
        return this.workerScope.getFunctionNames();
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScope
    @kp6
    public Set<Name> getVariableNames() {
        return this.workerScope.getVariableNames();
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope
    /* JADX INFO: renamed from: recordLookup */
    public void mo176recordLookup(@kp6 Name name, @kp6 LookupLocation lookupLocation) {
        cr4.g(name, AppMeasurementSdk.ConditionalUserProperty.NAME);
        cr4.g(lookupLocation, "location");
        this.workerScope.mo176recordLookup(name, lookupLocation);
    }

    @kp6
    public String toString() {
        return "Classes from " + this.workerScope;
    }

    @Override // kotlin.reflect.jvm.internal.impl.resolve.scopes.MemberScopeImpl, kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope
    @kp6
    public List<ClassifierDescriptor> getContributedDescriptors(@kp6 DescriptorKindFilter descriptorKindFilter, @kp6 sq3<? super Name, Boolean> sq3Var) {
        cr4.g(descriptorKindFilter, "kindFilter");
        cr4.g(sq3Var, "nameFilter");
        DescriptorKindFilter descriptorKindFilterRestrictedToKindsOrNull = descriptorKindFilter.restrictedToKindsOrNull(DescriptorKindFilter.Companion.getCLASSIFIERS_MASK());
        if (descriptorKindFilterRestrictedToKindsOrNull == null) {
            return ik2.a;
        }
        Collection<DeclarationDescriptor> contributedDescriptors = this.workerScope.getContributedDescriptors(descriptorKindFilterRestrictedToKindsOrNull, sq3Var);
        ArrayList arrayList = new ArrayList();
        for (Object obj : contributedDescriptors) {
            if (obj instanceof ClassifierDescriptorWithTypeParameters) {
                arrayList.add(obj);
            }
        }
        return arrayList;
    }
}
