Open t-kalinowski opened 3 days ago
This approach of using pkgname::classname()
might not work, because new_class()
is expected to run at package build time, before package exports are fully known (i.e., before a call like ::
or getNamespaceExports()
or getExportedValue()
will work correctly).
We might have to change the parent environment of the constructor to the environment where new_class()
is called. Though, that also brings challenges even in S7 itself, like:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘S7’:
.onLoad failed in loadNamespace() for 'S7', details:
call: NULL
error: 'new_object' is not an exported object from 'namespace:S7'
Error: loading failed
Qualifying calls by the namespace should only be necessary when referencing class from another package. Would avoiding unnecessary qualification resolve the issue?
This is starting to feel related to #341
OOPWG notes: This should be fixed and merged before release.
This PR changes a constructor default formal value from an inlined class call, to a call like
pkgname::classname()
, ifclass@package
is notNULL
.closes #477
With this PR: