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

Disallow modification of env of a struct or an enum #262

Merged
merged 3 commits into from
Jun 9, 2024

Conversation

yutannihilation
Copy link
Owner

Close #261

library(savvyExamples)

# struct
Person$new_method <- function() NULL
#> Error: Person cannot be modified
p <- Person$new()
p$.ptr <- NULL
#> Error: Person cannot be modified
# enum
FooEnum$A <- NULL
#> Error: FooEnum cannot be modified
FooEnum$C <- "C"
#> Error: FooEnum cannot be modified
a <- FooEnum$A
a$.ptr <- NULL
#> Error: FooEnum cannot be modified

Created on 2024-06-09 with reprex v2.1.0

@yutannihilation yutannihilation merged commit 9cec478 into main Jun 9, 2024
@yutannihilation yutannihilation deleted the fix/issue-261-immutable-env branch June 9, 2024 03:09
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.

Lock enviroment and bindings?
1 participant