private TypeSubstitution inferTypeSubstitutionInWildcardType(MethodJavaSymbol method, TypeSubstitution substitution, WildCardType formalType, JavaType argType, boolean variableArity, List<JavaType> remainingArgTypes) { JavaType newArgType = argType; if (argType.isTagged(JavaType.WILDCARD)) { newArgType = ((WildCardType) argType).bound; } TypeSubstitution newSubstitution = inferTypeSubstitution(method, substitution, formalType.bound, newArgType, variableArity, remainingArgTypes); return mergeTypeSubstitutions(substitution, newSubstitution); }
private TypeSubstitution inferTypeSubstitutionInWildcardType(MethodJavaSymbol method, TypeSubstitution substitution, WildCardType formalType, JavaType argType, boolean variableArity, List<JavaType> remainingArgTypes) { JavaType newArgType = argType; if (argType.isTagged(JavaType.WILDCARD)) { newArgType = ((WildCardType) argType).bound; } TypeSubstitution newSubstitution = inferTypeSubstitution(method, substitution, formalType.bound, newArgType, variableArity, remainingArgTypes); return mergeTypeSubstitutions(substitution, newSubstitution); }
private TypeSubstitution inferTypeSubstitutionInArrayType(MethodJavaSymbol method, TypeSubstitution substitution, ArrayJavaType formalType, JavaType argType, boolean variableArity, List<JavaType> remainingArgTypes) { JavaType newArgType = null; if (argType.isArray()) { newArgType = ((ArrayJavaType) argType).elementType; } else if (variableArity) { newArgType = (JavaType) leastUpperBound.leastUpperBound(mapToBoxedSet(remainingArgTypes)); } if (newArgType != null) { TypeSubstitution newSubstitution = inferTypeSubstitution(method, substitution, formalType.elementType, newArgType, variableArity, remainingArgTypes); return mergeTypeSubstitutions(substitution, newSubstitution); } return substitution; }
private TypeSubstitution inferTypeSubstitutionInArrayType(MethodJavaSymbol method, TypeSubstitution substitution, ArrayJavaType formalType, JavaType argType, boolean variableArity, List<JavaType> remainingArgTypes) { JavaType newArgType = null; if (argType.isArray()) { newArgType = ((ArrayJavaType) argType).elementType; } else if (variableArity) { newArgType = (JavaType) leastUpperBound.leastUpperBound(mapToBoxedSet(remainingArgTypes)); } if (newArgType != null) { TypeSubstitution newSubstitution = inferTypeSubstitution(method, substitution, formalType.elementType, newArgType, variableArity, remainingArgTypes); return mergeTypeSubstitutions(substitution, newSubstitution); } return substitution; }
List<JavaType> argTypeSubstitutedTypes = parametrizedArgType.typeSubstitution.substitutedTypes(); TypeSubstitution newSubstitution = inferTypeSubstitutionRec(method, formalTypeSubstitutedTypes, argTypeSubstitutedTypes); return mergeTypeSubstitutions(substitution, newSubstitution); TypeSubstitution newSubstitution = inferTypeSubstitutionInParameterizedType(method, substitution, formalType, superclass, variableArity, remainingArgTypes); if (!newSubstitution.substitutedTypes().isEmpty()) { result = mergeTypeSubstitutions(substitution, newSubstitution); TypeSubstitution newSubstitution = inferTypeSubstitutionInParameterizedType(method, substitution, formalType, superclass, variableArity, remainingArgTypes); if (!newSubstitution.substitutedTypes().isEmpty()) { result = mergeTypeSubstitutions(result, newSubstitution); if (sameErasure(formalType, superType)) { TypeSubstitution newSubstitution = inferTypeSubstitution(method, substitution, formalType, superType, variableArity, remainingArgTypes); result = mergeTypeSubstitutions(substitution, newSubstitution); break;
List<JavaType> argTypeSubstitutedTypes = parametrizedArgType.typeSubstitution.substitutedTypes(); TypeSubstitution newSubstitution = inferTypeSubstitutionRec(method, formalTypeSubstitutedTypes, argTypeSubstitutedTypes); return mergeTypeSubstitutions(substitution, newSubstitution); TypeSubstitution newSubstitution = inferTypeSubstitutionInParameterizedType(method, substitution, formalType, superclass, variableArity, remainingArgTypes); if (!newSubstitution.substitutedTypes().isEmpty()) { result = mergeTypeSubstitutions(substitution, newSubstitution); TypeSubstitution newSubstitution = inferTypeSubstitutionInParameterizedType(method, substitution, formalType, superclass, variableArity, remainingArgTypes); if (!newSubstitution.substitutedTypes().isEmpty()) { result = mergeTypeSubstitutions(result, newSubstitution); if (sameErasure(formalType, superType)) { TypeSubstitution newSubstitution = inferTypeSubstitution(method, substitution, formalType, superType, variableArity, remainingArgTypes); result = mergeTypeSubstitutions(substitution, newSubstitution); break;