public void setAttr(Scope s, @NotNull Type v, int tag) {
        Type targetType = resolveExpr(target, s, tag);
        if (targetType.isUnionType()) {
            Set<Type> types = targetType.asUnionType().getTypes();
            for (Type tp : types) {
                setAttrType(tp, v, tag);
            }
        } else {
            setAttrType(targetType, v, tag);
        }
    }