The R Project SVN R

Rev

Rev 76046 | Rev 77804 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 76046 Rev 77383
Line 971... Line 971...
971
cd <- getClassDef("Ap")
971
cd <- getClassDef("Ap")
972
body(cd@contains[["A"]]@coerce)[[2]] ## >>   value <- new("A")
972
body(cd@contains[["A"]]@coerce)[[2]] ## >>   value <- new("A")
973
## was ... <-  new(structure("A", package = ".GlobalEnv"))
973
## was ... <-  new(structure("A", package = ".GlobalEnv"))
974
## for a few days in R-devel (Nov.2017)
974
## for a few days in R-devel (Nov.2017)
975
 
975
 
-
 
976
 
-
 
977
## canCoerce(obj, .)  when length(class(obj)) > 1 :
-
 
978
setOldClass("foo")
-
 
979
setAs("foo", "A", function(from) new("A", foo=from))
-
 
980
o3 <- structure(1:7, class = c("foo", "bar"))
-
 
981
stopifnot( canCoerce(o3, "A") )
-
 
982
## failed in R <= 3.6.1