Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icecream and rlang 1.0.0 #8

Closed
lionel- opened this issue Sep 30, 2021 · 1 comment · Fixed by #10
Closed

icecream and rlang 1.0.0 #8

lionel- opened this issue Sep 30, 2021 · 1 comment · Fixed by #10
Assignees

Comments

@lionel-
Copy link

lionel- commented Sep 30, 2021

Hello, I see in revdep checks:

  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-icecream.R:76:3): source file is correctly identified ─────────
  `f()` did not throw the expected message.

I took a look and it's because you're subsetting the object returned by trace_back(). The structure of this object was undocumented and has now changed (as well as become public). You can fix your package with this patch:

modified   R/ic.R
@@ -25,10 +25,10 @@ ic <- function(x) {
   # In the event that icecream is totally disabled we will just return the input.
   if (getOption("icecream.enabled")) {
     trace <- trace_back()
-    num_calls <- length(trace$calls)
+    num_calls <- length(trace$call)
 
-    parent_ref <-  if (num_calls > 1) trace$calls[[num_calls - 1]][[1]] else NULL
-    ref <- attr(trace$calls[[num_calls]], "srcref")
+    parent_ref <-  if (num_calls > 1) trace$call[[num_calls - 1]][[1]] else NULL
+    ref <- attr(trace$call[[num_calls]], "srcref")
     loc <- src_loc(ref)
 
     # Case when location of file is unavailable

We plan to release rlang 1.0.0 in 2 to 4 weeks.

@lewinfox lewinfox self-assigned this Sep 30, 2021
@lewinfox
Copy link
Owner

Thanks @lionel- appreciate you taking the time to send a patch! I've got some housekeeping to do anyway so this is a good incentive. Cheers 👍

lewinfox added a commit that referenced this issue Oct 3, 2021
@lewinfox lewinfox mentioned this issue Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants