Skip to content
Snippets Groups Projects
Commit e1d2ceaa authored by Adam Welc's avatar Adam Welc
Browse files

Functions are now shareable and, as such, must be properly transitioned when passed as arguments.

parent 116f4560
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,9 @@ public abstract class WrapArgumentBaseNode extends RNode {
} else if (result instanceof RLanguage) {
everSeenLanguage.enter();
return (RLanguage) result;
} else if (result instanceof RFunction) {
everSeenLanguage.enter();
return (RFunction) result;
} else {
nonShareable.enter();
return null;
......
......@@ -44,6 +44,8 @@ public class TestSimpleAttributes extends TestBase {
assertEval("{ attributes(NULL) }");
assertEval("{ x<-function() 42; attr(x, \"foo\")<-\"foo\"; y<-x; attr(y, \"foo\")<-NULL; x }");
assertEval("{ f<-function(y) attr(y, \"foo\")<-NULL; x<-function() 42; attr(x, \"foo\")<-\"foo\"; s<-\"bar\"; switch(s, f(x)); x }");
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment