void (@Nullable PyType type, @NotNull TypeEvalContext context) { if (type == null || type instanceof PyNoneType || type instanceof PyGenericType) { return; } else if (type instanceof PyUnionType) { for (PyType memberType : ((PyUnionType)type).getMembers()) { checkPep484Compatibility(memberType, context); } } else if (type instanceof PyCollectionType) { for (PyType typeParam : ((PyCollectionType)type).getElementTypes()) { checkPep484Compatibility(typeParam, context); } } else if (type instanceof PyClassType) { // In this order since PyCollectionTypeImpl implements PyClassType } else if (type instanceof PyCallableType callableType) { for (PyCallableParameter parameter : ContainerUtil.notNullize(callableType.getParameters(context))) { checkPep484Compatibility(parameter.getType(context), context); } checkPep484Compatibility(callableType.getReturnType(context), context); } else { throw new Pep484IncompatibleTypeException( PyPsiBundle.message("INTN.add.type.hint.for.variable.PEP484.incompatible.type", type.getName())); } }