We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af6f4e8 commit c716904Copy full SHA for c716904
R/ggproto.R
@@ -131,7 +131,14 @@ fetch_ggproto <- function(x, name) {
131
if (is.null(super)) {
132
# no super class
133
} else if (is.function(super)) {
134
- res <- fetch_ggproto(super(), name)
+ parent <- super()
135
+ if (!identical(parent, x)) {
136
+ # happy path
137
+ return(fetch_ggproto(parent, name))
138
+ }
139
+ cli::cli_abort(
140
+ "{.cls {class(x)[1]}} cannot have a circular definition."
141
+ )
142
} else {
143
cli::cli_abort(c(
144
"{class(x)[[1]]} was built with an incompatible version of ggproto.",
0 commit comments