Skip to content

Active bindings turned into constants during package build #152

@mllg

Description

@mllg

Here is a small package to illustrate the issue:

https://github.com/mllg/r6pkg

Everything works out fine while loading the package interactively (using devtools' load_all()):

load_all()
print(bar)
<foo>
  Public:
    clone: function (deep = FALSE)
    x: 10
    x_squared: active binding

The active binding is lost after installing and loading the package in a fresh R session via library():

library(r6pkg)
print(bar)
<foo>
  Public:
    clone: function (deep = FALSE)
    x: 10
    x_squared: 100

Looks like the binding gets evaluated during R CMD build and the returned value is stored instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions