8000 Abort when ggproto definition is circular by teunbrand · Pull Request #6648 · tidyverse/ggplot2 · GitHub
[go: up one dir, main page]

Skip to content

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #6583.

AFAICT, we cannot detect this during object construction.
The second best way to detect this is in fetch_ggproto(), as it is such a widely used accessor.
Reprex from issue:

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

A <- ggproto("A")
A <- ggproto(NULL, A)
A
#> Error in `fetch_ggproto()` at ggplot2/R/ggproto.R:172:3:
#> ! <A> cannot have a circular definition.

Created on 2025-09-25 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing error with circular ggproto definitions

1 participant

0