PyType (@NotNull PyTargetExpression target, @NotNull PyTupleExpression parentTuple, @NotNull PyType assignedType, @NotNull TypeEvalContext context) { if (assignedType instanceof PyTupleType) { return getTargetTypeFromTupleAssignment(target, parentTuple, (PyTupleType)assignedType); } else if (assignedType instanceof PyClassLikeType) { return StreamEx .of(((PyClassLikeType)assignedType).getAncestorTypes(context)) .select(PyNamedTupleType.class) .findFirst() .map(t -> getTargetTypeFromTupleAssignment(target, parentTuple, t)) .orElse(null); } return null; }