renjin
renjin copied to clipboard
Recursive validObject does not work on formulas
Hi everyone,
I'm having an issue when validating an object recursively that contains a formula, an exception is thrown from Renjin:
org.renjin.eval.EvalException: object 'sloti' not found
at org.renjin.sexp.Symbol.eval(Symbol.java:329)
at org.renjin.sexp.Promise.doEval(Promise.java:87)
at org.renjin.sexp.Promise.force(Promise.java:81)
at org.renjin.sexp.Symbol.eval(Symbol.java:337)
at org.renjin.sexp.Promise.doEval(Promise.java:87)
at org.renjin.sexp.Promise.force(Promise.java:81)
at org.renjin.primitives.R$primitive$identical.applyPromised(R$primitive$identical.java:27)
at org.renjin.sexp.BuiltinFunction.apply(BuiltinFunction.java:100)
at org.renjin.primitives.special.InternalFunction.apply(InternalFunction.java:46)
at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
at org.renjin.sexp.Closure.applyPromised(Closure.java:200)
at org.renjin.sexp.Closure.apply(Closure.java:133)
at org.renjin.primitives.special.RecallFunction.apply(RecallFunction.java:43)
at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
at org.renjin.sexp.Promise.doEval(Promise.java:87)
at org.renjin.sexp.Promise.force(Promise.java:81)
Here is a simple code to reproduce the issue on either Java or R:
Java:
rEngine.eval("validObject(~1,complete=TRUE)");
R:
validObject(~1,complete=TRUE)
However, there is no issue when "complete" argument is omitted. Am I missing something? The code works on GNU R 3.5.3 and returns TRUE. I'm using Renjin 3.5-beta76 in a Java project.
This is just a comment to make it easier to investigate later (I dont have the time right now to look into this). The validObject code begins on line 429 here: https://github.com/bedatadriven/renjin/blob/master/packages/methods/R/SClasses.R From a brief look at the code, I see no obvious reason why setting complete to true should cause this issue though.