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

Child objects with abstract parents cannot have read-only properties #269

Closed
jl5000 opened this issue Dec 12, 2022 · 0 comments · Fixed by #288
Closed

Child objects with abstract parents cannot have read-only properties #269

jl5000 opened this issue Dec 12, 2022 · 0 comments · Fixed by #288
Labels
bug an unexpected problem or unintended behavior

Comments

@jl5000
Copy link

jl5000 commented Dec 12, 2022

library(R7)

parent <- new_class("new_class", abstract = TRUE)

child <- new_class("child", parent = parent,
                   properties = list(
                     x = new_property(class_character,
                                      getter = function(self) "test") 
                       ))
child()
#> Error: Can't set read-only property <child>@x

Created on 2022-12-12 with reprex v2.0.2

@hadley hadley added the bug an unexpected problem or unintended behavior label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants