You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: deparse(conditionCall(cnd)) fails for errors raised in S7 methods #783
Errors raised inside an S7 method record a call that contains the dispatched S7 object.
On R 4.3.3 that call can't be deparsed, so any tool using conditionCall() crashes.
library(S7)
Foo<- new_class("Foo")
g<- new_generic("g", "x")
method(g, Foo) <-function(x) stop("boom")
cnd<- tryCatch(g(Foo()), error=identity)
deparse(conditionCall(cnd))
#> Error in deparse(conditionCall(cnd)) :#> 'S4SXP': should not happen - please report
rlang::as_label(conditionCall(cnd)) fails the same way.
The call's head is the method(g, Foo) symbol. Its dispatch argument is a forced promise holding the S7 object it looks like R-devel has a commit makes deparse() handle these objects, but released R versions still fail.
Could S7 record a call that succesfully deparses, without expecting updating to R-devel?
Session info
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 4.3.3 (2024-02-29)
os macOS 27.0
system aarch64, darwin20
ui X11
language (EN)
collate en_CA.UTF-8
ctype en_CA.UTF-8
tz America/Toronto
date 2026-10-14
─ Packages ───────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
S7 * 0.2.2.9000 2026-10-14 [1] Github (426c13e)
Related: #318, which was closed as tracked in base R.
Thanks for opening this issue. You don’t need to switch to R-devel: this deparsing error was fixed in R 4.4.0, released in April 2024, over two years ago. Updating to R 4.4 or a later stable release should resolve it. If upgrading isn’t an option, we also have a draft S7 fix for R 4.2 and 4.3.
Activity
Only route S7-object arguments through `...` in method calls (RConsor…
t-kalinowski commentedon Oct 14, 2026
Thanks for opening this issue. You don’t need to switch to R-devel: this deparsing error was fixed in R 4.4.0, released in April 2024, over two years ago. Updating to R 4.4 or a later stable release should resolve it. If upgrading isn’t an option, we also have a draft S7 fix for R 4.2 and 4.3.
jjjermiah commentedon Oct 20, 2026
oh this is great thank you!!!