@@ -910,6 +910,8 @@ position_args_with_int64_to_int_coercion = function(sys_call, eval_frame, skipLa
910910# ' @rdname extract.replace.integer64
911911# ' @export
912912`[.integer64` = function (x , i , j , ... , drop = TRUE ) {
913+ old_class = oldClass(x )
914+
913915 sc = sys.call() # NB: not match.call(), which eats a missing argument in x[1, , 3]
914916 pf = parent.frame()
915917 args = position_args_with_int64_to_int_coercion(sc , pf )
@@ -963,7 +965,7 @@ position_args_with_int64_to_int_coercion = function(sys_call, eval_frame, skipLa
963965 dim(ret ) = if (length(newDim )) newDim else NULL
964966 }
965967
966- oldClass(ret ) = " integer64 "
968+ oldClass(ret ) = old_class
967969 ret
968970}
969971
@@ -981,9 +983,10 @@ position_args_with_int64_to_int_coercion = function(sys_call, eval_frame, skipLa
981983 ret = withCallingHandlers_and_choose_call(do.call(`[<-` , c(list (x = x ), args )), c(" [<-" , " [<-.integer64" ))
982984 } else {
983985 args $ value = as.integer64(value )
986+ old_class = oldClass(x )
984987 oldClass(x ) = NULL
985988 ret = withCallingHandlers_and_choose_call(do.call(`[<-` , c(list (x = x ), args )), c(" [<-" , " [<-.integer64" ))
986- oldClass(ret ) = " integer64 "
989+ oldClass(ret ) = old_class
987990 }
988991 ret
989992}
@@ -996,9 +999,10 @@ position_args_with_int64_to_int_coercion = function(sys_call, eval_frame, skipLa
996999 el = as.integer(el )
9971000 el
9981001 })
1002+ old_class = oldClass(x )
9991003 oldClass(x ) = NULL
10001004 withCallingHandlers_and_choose_call({ret = do.call(`[[` , c(list (x = x ), args ))}, c(" [[" , " [[.integer64" ))
1001- oldClass(ret ) = " integer64 "
1005+ oldClass(ret ) = old_class
10021006 ret
10031007}
10041008
@@ -1017,9 +1021,10 @@ position_args_with_int64_to_int_coercion = function(sys_call, eval_frame, skipLa
10171021 withCallingHandlers_and_choose_call({ret = do.call(`[[<-` , c(list (x = x ), args ))}, c(" [[<-" , " [[<-.integer64" ))
10181022 } else {
10191023 args $ value = as.integer64(value )
1024+ old_class = oldClass(x )
10201025 oldClass(x ) = NULL
10211026 withCallingHandlers_and_choose_call({ret = do.call(`[[<-` , c(list (x = x ), args ))}, c(" [[<-" , " [[<-.integer64" ))
1022- oldClass(ret ) = " integer64 "
1027+ oldClass(ret ) = old_class
10231028 }
10241029 ret
10251030}
@@ -1059,7 +1064,7 @@ cbind.integer64 = function(...) {
10591064 oldClass(l [[k ]]) <- NULL
10601065 }
10611066 ret = do.call(cbind , l )
1062- oldClass(ret ) <- " integer64"
1067+ oldClass(ret ) = " integer64"
10631068 ret
10641069}
10651070
@@ -1077,7 +1082,7 @@ rbind.integer64 = function(...) {
10771082 oldClass(l [[k ]]) <- NULL
10781083 }
10791084 ret = do.call(rbind , l )
1080- oldClass(ret ) <- " integer64"
1085+ oldClass(ret ) = " integer64"
10811086 ret
10821087}
10831088
@@ -1096,10 +1101,10 @@ as.data.frame.integer64 = function(x, row.names=NULL, optional=FALSE, ...) {
10961101
10971102# ' @export
10981103rep.integer64 = function (x , ... ) {
1099- cl <- oldClass(x )
1100- ret <- NextMethod()
1101- oldClass(ret ) <- cl
1102- ret
1104+ cl = oldClass(x )
1105+ ret = NextMethod()
1106+ oldClass(ret ) = cl
1107+ ret
11031108}
11041109
11051110# FIXME no method dispatch for :
0 commit comments