You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
& and | are generics, so methods can be defined for which the output is not logical.
This is the case for base octmode class which has an & method to do bitwise-and (much like C/Python's &) and returns octmode (see ?"&.octmode"). As seen in base R:
if (is.null(extra_flags) && grepl("/(configure|cleanup)$", f) &&
(mode&"111") != as.octmode("111")) {
# ^ marked as a lint
warning(gettextf("file '%s' did not have execute permissions: corrected", f), domain=NA, call.=FALSE)
mode<-mode|"111"
}
The giveaway here is that a comparison operator is used in the <expr> above & -- IINM vector_logic_linter() assumes parent infixes will be &/&&/|/||.
My first instinct was just to call this a known edge case & move on, because in general we can't swap && for all methods of &, but for this particular method we can detect it's fine statically.
The text was updated successfully, but these errors were encountered:
&
and|
are generics, so methods can be defined for which the output is notlogical
.This is the case for base
octmode
class which has an&
method to do bitwise-and (much like C/Python's&
) and returnsoctmode
(see?"&.octmode"
). As seen in base R:https://github.com/r-devel/r-svn/blob/9bcb4bef2979e608804fb37ab6471b4894bfa2b2/src/library/utils/R/tar.R#L497
The giveaway here is that a comparison operator is used in the
<expr>
above&
-- IINMvector_logic_linter()
assumes parent infixes will be&
/&&
/|
/||
.My first instinct was just to call this a known edge case & move on, because in general we can't swap
&&
for all methods of&
, but for this particular method we can detect it's fine statically.The text was updated successfully, but these errors were encountered: