package kotlin.reflect.w.internal;

import g.h.a.i;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.WildcardType;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.o;
import kotlin.reflect.w.internal.y0.d.b;
import kotlin.reflect.w.internal.y0.d.w;

/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\u0006\b\u0000\u0010\u0002 \u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "Ljava/lang/reflect/Type;", "R", "invoke"}, k = 3, mv = {1, 7, 1}, xi = 48)
public final class j extends Lambda implements Function0<Type> {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ KCallableImpl<R> f6314f;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public j(KCallableImpl<? extends R> kCallableImpl) {
        super(0);
        this.f6314f = kCallableImpl;
    }

    @Override // kotlin.jvm.functions.Function0
    public Type invoke() {
        Type[] lowerBounds;
        KCallableImpl<R> kCallableImpl = this.f6314f;
        b bVarO = kCallableImpl.o();
        Type type = null;
        w wVar = bVarO instanceof w ? (w) bVarO : null;
        if (wVar != null && wVar.isSuspend()) {
            Object objF = kotlin.collections.j.F(kCallableImpl.l().a());
            ParameterizedType parameterizedType = objF instanceof ParameterizedType ? (ParameterizedType) objF : null;
            if (o.a(parameterizedType != null ? parameterizedType.getRawType() : null, Continuation.class)) {
                Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
                o.e(actualTypeArguments, "continuationType.actualTypeArguments");
                Object objV3 = i.v3(actualTypeArguments);
                WildcardType wildcardType = objV3 instanceof WildcardType ? (WildcardType) objV3 : null;
                if (wildcardType != null && (lowerBounds = wildcardType.getLowerBounds()) != null) {
                    type = (Type) i.O0(lowerBounds);
                }
            }
        }
        return type == null ? this.f6314f.l().getF6425b() : type;
    }
}
