Here is how to reproduce: setClass("A", slots=c(stuff="ANY")) setClass("B", contains="A") setClass("C", contains="B") a <- new("A") b <- new("B") c <- new("C") setGeneric("foo", function(x) standardGeneric("foo")) setMethod("foo", "A", function(x) "A") setMethod("foo", "C", function(x) c(callNextMethod(x), "C")) foo(a) # A foo(b) # A foo(c) # A C setMethod("foo", "B", function(x) c(callNextMethod(x), "B")) foo(a) # A foo(b) # A B foo(c) # A C <--- wrong! Looks like some caching is getting in the way. Problem goes away when defining the foo#C method again: setMethod("foo", "C", function(x) c(callNextMethod(x), "C")) foo(a) # A foo(b) # A B foo(c) # A B C <--- ok Thanks, H.
Thanks, I've fixed this. Just need to test and commit.