PyType (@NotNull PsiElement element, @NotNull Context context) { if (element instanceof PySubscriptionExpression subscriptionExpr) { final PyExpression operand = subscriptionExpr.getOperand(); final Collection<String> operandNames = resolveToQualifiedNames(operand, context.getTypeContext()); if (operandNames.contains(UNION)) { return PyUnionType.union(getIndexTypes(subscriptionExpr, context)); } } return null; }