Skip to content

Commit 46478b5

Browse files
Handle a quosure properly. Closes #3552
1 parent a1143e1 commit 46478b5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

R/aes-calculated.r

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ is_calculated <- function(x) {
4242
FALSE
4343
} else if (is.symbol(x)) {
4444
is_dotted_var(as.character(x))
45+
} else if (is_quosure(x)) {
46+
is_calculated(quo_get_expr(x))
4547
} else if (is.call(x)) {
4648
if (identical(x[[1]], quote(stat))) {
4749
TRUE
@@ -66,6 +68,12 @@ strip_dots <- function(expr) {
6668
} else {
6769
expr
6870
}
71+
} else if (is_quosure(expr)) {
72+
# strip dots from quosure and reconstruct the quosure
73+
expr <- new_quosure(
74+
strip_dots(quo_get_expr(expr)),
75+
quo_get_env(expr)
76+
)
6977
} else if (is.call(expr)) {
7078
if (identical(expr[[1]], quote(stat))) {
7179
strip_dots(expr[[2]])

0 commit comments

Comments
 (0)