nCompiler icon indicating copy to clipboard operation
nCompiler copied to clipboard

use of `class(x) ==` vs. `inherits`

Open paciorek opened this issue 3 months ago • 0 comments

CRAN usually complains about checking class membership with ==, as I see in cases in NC_LoadedObjEnv.R, e.g.,

get_DLLenv <- function(obj) {
  if(class(obj)[1] == "CnClass_env") parent.env(obj)
  else if(class(obj)[1] == "loadedObjectEnv")
    parent.env(parent.env(obj))
  else
    stop("DLLenv not available.")
}

paciorek avatar Jan 16 '26 19:01 paciorek