When I subclass the integer64 object from bit64 and then perform a equality test, the result contains logical data, but is still classed with my class rather than being logical. This doesn't happen with integer for example.
Sample code:
library(bit64)
x = as.integer64(5)
class(x) = c("Foo", "integer64")
x == 5
returns
[1] TRUE
attr(,"class")
[1] "Foo"
Notice that it still has class "Foo"
While if we do the same with integer:
y = as.integer(5)
class(y) = c("Foo", "integer")
y == 5
It returns logical
[1] TRUE
Any idea why is this happening?