Skip to content

Confusing error with circular ggproto definitions #6583

@teunbrand

Description

@teunbrand

By accident you can sometimes try to circularly define a ggproto class.
Trying to do anything with the class will inevitably result in an error.
In the example below, printing will give the error:

library(ggplot2)

A <- ggproto("A")
A <- ggproto(NULL, A)
A
#> Error in `<current-expression>` : node stack overflow

I think this error could be caught and its message improved. From initial exploration, it seems we can do this in fetch_ggproto().

Metadata

Metadata

Assignees

No one assigned

    Labels

    messagesrequests for improvements to error, warning, or feedback messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions