Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to lifecycle::deprecate_warn() an R6 method #54

Closed
colearendt opened this issue Aug 1, 2020 · 3 comments · Fixed by #76
Closed

A way to lifecycle::deprecate_warn() an R6 method #54

colearendt opened this issue Aug 1, 2020 · 3 comments · Fixed by #76

Comments

@colearendt
Copy link

Deprecating an R6 method does not currently work because the "function" being deprecated does not actually exist (but needs to be instantiated by initializing a class)

@hadley
Copy link
Member

hadley commented Jan 8, 2021

Minimal reprex:

A <- R6::R6Class("A", list(
  old_f = function() {
    lifecycle::deprecate_warn("1.0.0", "A$old_f()", "A$new_f()")
    self$new_f()
  },
  new_f = function() {
    "10"
  }
))
A$new()$old_f()
#> Error: Internal error: `what` must refer to a function name.

Created on 2021-01-08 by the reprex package (v0.3.0.9001)

hadley added a commit that referenced this issue Jan 8, 2021
hadley added a commit that referenced this issue Jan 11, 2021
@kpagacz
Copy link

kpagacz commented Feb 9, 2021

What about active bindings?

@hadley
Copy link
Member

hadley commented Feb 9, 2021

@kpagacz what about them? If there's a problem, please create a reprex and file a new issue.

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 a pull request may close this issue.

3 participants