Skip to content
Prev 32073 / 63424 Next

Recent setClass fails where previous succeeded

These lines of code

setClass("A", representation(x="numeric"))
setMethod(initialize, "A", function(.Object, ...) stop("oops"))
setClass("B", representation("A"))

result in
Error in initialize(value, ...) : oops

in

R version 2.9.0 alpha (2009-03-28 r48239)
R version 2.10.0 Under development (unstable) (2009-03-28 r48239) 

but not in r48182. 

In addition, in package code, the error above does NOT lead to removal
of the partially installed package, or of the lock on the package
directory, corrupting the user installation.

For more context, the actual code adds arguments to initialize and
expects them to be provided by calls to 'new'; 'new' is not exposed
directly to the user but via a constructor that always provides
appropriate arguments. A specific example occurs when trying to
install the package Biostrings v 2.11.44 from the Bioconductor devel
repository.

Martin