futureverse / futureverse/globals

S3 methods in local environment are not identified

Open
#91 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
R
Stars
29
Forks
3
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Originally mentioned in https://github.com/HenrikBengtsson/globals/issues/2, identification of local S3 methods is mentioned to be fixed in https://github.com/HenrikBengtsson/globals/commit/7847dd58d8101f22dc226bbb4d3d5de7d623adde (2018).

https://github.com/HenrikBengtsson/globals/issues/47 seems to be for S3 methods in packages specifically.

Related: https://github.com/mschubert/clustermq/issues/256

**Reproduce example**

```r
f = function(i) UseMethod('f')
f.numeric = function(i) sqrt(i)
globals::globalsOf({ f(1) }, locals=TRUE, recursive=TRUE) # addS3 is no longer documented
# list()
```

The [originally included test](https://github.com/HenrikBengtsson/globals/commit/7847dd58d8101f22dc226bbb4d3d5de7d623adde#diff-3d26a0530209716e2c6a81837ff094ba1562bc11c9f4ad210508f264c2f31481) also seems to fail now, although it is no longer available. I also no longer see any mention on `S3` in the tests or any changes to `S3` behavior in the NEWS.

**Expected behavior**

Shouldn't this identify `f.numeric`?

**Session information**

R version 4.3.2, globals_0.16.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.