From 0baca8fb4f57ef31dd3455439d5505dccaec1623 Mon Sep 17 00:00:00 2001 From: smeyer Date: Thu, 13 Jul 2023 13:00:57 +0000 Subject: [PATCH] mention 'Imports: methods' alternative, with caveats (PR#18540) git-svn-id: https://svn.r-project.org/R/trunk@84688 00db46b3-68df-0310-9c12-caf00c1e9a41 --- doc/manual/R-exts.texi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/manual/R-exts.texi b/doc/manual/R-exts.texi index 97209714630..c7341c7690a 100644 --- a/doc/manual/R-exts.texi +++ b/doc/manual/R-exts.texi @@ -4690,8 +4690,12 @@ standard function @code{c} in @pkg{base}. Some additional steps are needed for packages which make use of formal (S4-style) classes and methods (unless these are purely used -internally). The package should have @code{Depends: methods} in its -@file{DESCRIPTION} and @code{import(methods)} or +internally). The package should have +@code{Depends: methods}@footnote{@code{Imports: methods} may suffice, +but package code is little exercised without the @pkg{methods} package +on the search path and may not be fully robust to this scenario. +@c https://bugs.R-project.org/show_bug.cgi?id=18540#c10 +} in its @file{DESCRIPTION} and @code{import(methods)} or @code{importFrom(methods, ...)} plus any classes and methods which are to be exported need to be declared in the @file{NAMESPACE} file. For example, the @pkg{stats4} package has