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

Modified @<- operator to work with a fix for replacement's "value" argument.

parent b53dd030
Branches
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ import com.oracle.truffle.r.runtime.data.RPromise;
import com.oracle.truffle.r.runtime.data.RStringVector;
import com.oracle.truffle.r.runtime.data.RSymbol;
@RBuiltin(name = "@<-", kind = RBuiltinKind.PRIMITIVE, parameterNames = {"", "", ""}, nonEvalArgs = 1)
@RBuiltin(name = "@<-", kind = RBuiltinKind.PRIMITIVE, parameterNames = {"", "", "value"}, nonEvalArgs = 1)
public abstract class UpdateSlot extends RBuiltinNode {
@CompilationFinal RFunction checkSlotAssignFunction;
......
......@@ -113,5 +113,6 @@ public class TestSimpleAssignment extends TestBase {
assertEval("{ x <- 3 ; f <- function() { assign(\"x\", 4) ; g <- function() { assign(\"y\", 3) ; hh <- function() { assign(\"z\", 6) ; h <- function(s=1) { if (s==2) { x <- 5 } ; x } ; h() } ; hh() } ; g() } ; f() }");
assertEval(Output.ContainsError, "{ f <- function() { if (FALSE) { x <- 1 } ; g <- function() { x } ; g() } ; f() }");
assertEval("{ f <- function() { if (FALSE) { c <- 1 } ; g <- function() { c } ; g() } ; typeof(f()) }");
assertEval("{ `f<-` <- function(x, y=42, value) { x[1]<-value+y; x }; y<-1:10; f(y)<-7; y }");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment