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

Not correctly inferred caller expression #36

Open
fikovnik opened this issue Jul 9, 2020 · 0 comments
Open

Not correctly inferred caller expression #36

fikovnik opened this issue Jul 9, 2020 · 0 comments
Assignees
Labels
complexity:intermediate Resolution requires many changes and good understanding of code enhancement:bug Something isn't working urgency:high Issue needs to be resolved immediately

Comments

@fikovnik
Copy link
Member

fikovnik commented Jul 9, 2020

With tracing calls to eval function family, in the following:

f <- function(n, expr)
  g(n, eval.parent(substitute(function(...) expr)))

the caller expression get_caller(call)$caller_expression for f(1,1) from the call_exit_callback hook is inferred as f(1,1) instead of g(n, eval.parent(...)).

This is the relevant part of the sys.calls():

... ... ...
[[54]]
f(1, 1)
[[55]]
function(n, expr)
     g(integer(n), eval.parent(substitute(function(...) expr)))
[[56]]
for (x in xs) f(x)
[[57]]
eval(expr, p)
[[58]]
call_exit_callback(<pointer: 0x5616e64400c0>, <pointer: 0x5616e6a2fc30>, 
    <pointer: 0x5616e7b77130>, <pointer: 0x5616e6bcf790>, <pointer: 0x5616e3ee4bc0>)
@aviralg aviralg self-assigned this Jul 9, 2020
@aviralg aviralg added complexity:intermediate Resolution requires many changes and good understanding of code enhancement:bug Something isn't working urgency:high Issue needs to be resolved immediately labels Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:intermediate Resolution requires many changes and good understanding of code enhancement:bug Something isn't working urgency:high Issue needs to be resolved immediately
Projects
None yet
Development

No branches or pull requests

2 participants