Keep S7 := ahead of rlang and data.table#718
Draft
t-kalinowski wants to merge 2 commits into
Draft
Conversation
hadley
reviewed
Jun 25, 2026
| } | ||
|
|
||
| env <- as.environment(paste0("package:", pkgname)) | ||
| env[[".conflicts.OK"]] <- TRUE |
Member
There was a problem hiding this comment.
I think we should only ever apply this to S7 itself, and I think we can move it up to .onAttach() so we use it unconditionally when conflictRules() is not available.
hadley
reviewed
Jun 25, 2026
Comment on lines
+42
to
+45
| conflictRules <- get0("conflictRules", envir = baseenv(), inherits = FALSE) | ||
| if (is.null(conflictRules)) { | ||
| return(invisible()) | ||
| } |
Member
There was a problem hiding this comment.
I think it would be clearer to use an explicit version here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #697.
This is one possible solution for making S7's
:=operator the search-path binding users get when S7 is attached, regardless of whether rlang or data.table is attached before or after it. The approach prevents attach-order-dependent masking and removes noisy:=masking messages.User-facing changes
S7::`:=`now wins on the search path when used with rlang or data.table.:=masking messages.rlang::`:=`anddata.table::`:=`is unchanged.Internal changes
conflictRules()excludes for:=on rlang and data.table during S7 startup.:=conflict needs to be silenced.