diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqFunctions.java index c3fd500728362be44f4d04c20f8236cf97118da7..ee2e6a97586e167d60f555cd6b4d13fa4c56514b 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/SeqFunctions.java @@ -354,7 +354,8 @@ public final class SeqFunctions { @Child private ClassHierarchyNode classHierarchyNode = ClassHierarchyNode.create(); static { - Casts.noCasts(SeqAlong.class); + Casts casts = new Casts(SeqAlong.class); + casts.arg(0).mustNotBeMissing(Message.ARGUMENTS_PASSED, 0, "'seq_along'", 1); } @Specialization(guards = "!hasClass(value)") diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index 440ac65414ad32b7126fb05f6e1781f0e148f82b..57f734463d8a4bb4bd387d9254e61ccf87fe0e94 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -67789,6 +67789,10 @@ integer(0) [41] 26163.27 26367.35 26571.43 26775.51 26979.59 27183.67 27387.76 27591.84 [49] 27795.92 28000.00 +##com.oracle.truffle.r.test.builtins.TestBuiltin_seq_along.testWithNonStandardLength# +#seq_along() +Error in seq_along() : 0 arguments passed to 'seq_along' which requires 1 + ##com.oracle.truffle.r.test.builtins.TestBuiltin_seq_along.testWithNonStandardLength# #{ assign('length.myclass', function(...) 42, envir=.__S3MethodsTable__.); x <- 1; class(x) <- 'myclass'; res <- seq_along(x); rm('length.myclass', envir=.__S3MethodsTable__.); res } [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_seq_along.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_seq_along.java index e71494b48a9b932dbed42640ad664c807880a1fe..833573507bb54c19a45b9a65878a2ed9785318c4 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_seq_along.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_seq_along.java @@ -141,5 +141,6 @@ public class TestBuiltin_seq_along extends TestBase { assertEval(Output.IgnoreWarningContext, Output.IgnoreErrorContext, "{ x <- c(1,2,3); class(x) <- 'myclass'; length.myclass <- function(w) 'hello world'; seq_along(x) }"); assertEval("{ length <- function(x) 42; seq_along(c(1,2,3)) }"); assertEval("{ assign('length.myclass', function(...) 42, envir=.__S3MethodsTable__.); x <- 1; class(x) <- 'myclass'; res <- seq_along(x); rm('length.myclass', envir=.__S3MethodsTable__.); res }"); + assertEval("seq_along()"); } }