diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java index f79c0a4863229b0c2c95824a014272c403e26b2d..27deb99948450b5b52e7f1084238b4ba342e1c98 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/OptionsFunctions.java @@ -136,7 +136,7 @@ public class OptionsFunctions { if (nn instanceof RStringVector) { thisListnames = (RStringVector) nn; } else { - throw RInternalError.shouldNotReachHere(); + throw RError.error(RError.SHOW_CALLER, Message.LIST_NO_VALID_NAMES); } Object[] listData = new Object[list.getLength()]; String[] listNames = new String[listData.length]; diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java index 081c587999d6d92b74275099bb64fcc3eafeca0a..851e8053676665a50ea3523d3b4f979016d563d7 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/UpdateOldClass.java @@ -91,6 +91,11 @@ public abstract class UpdateOldClass extends RBuiltinNode.Arg2 { return result; } + @Specialization + protected Object setOldClass(@SuppressWarnings("unused") RNull arg, @SuppressWarnings("unused") RNull className) { + return RNull.instance; + } + @Specialization protected Object setOldClass(@SuppressWarnings("unused") RNull arg, @SuppressWarnings("unused") Object className) { throw error(Message.INVALID_NULL_LHS); diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java index 9a3ada865ce54def12b11b86acf8f475580fe95b..30896b1446fccb004ddfc74b1a6964a6637fbf8a 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java @@ -446,7 +446,9 @@ public final class SpecialAttributesFunctions { RList dimNames = getDimNames.getDimNames(x); if (dimNames != null && dimNames.getLength() == 1) { dimNamesAvlProfile.enter(); - return dimNames.getDataAt(0); + Object dimName = dimNames.getDataAt(0); + return (dimName != RNull.instance) ? dimName : null; // For + // ".Dimnames=list(NULL)" } return null; } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java index d18ab9390b6ce60651bbf35cc2a0b3247d4bb727..8e0f4da8cea9e117c665ca60c6e8aaea3b68c409 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java @@ -895,7 +895,8 @@ public final class RError extends RuntimeException implements TruffleException { INVALID_SUBSTRING_ARGS("invalid substring arguments"), OBJECT_SIZE_ESTIMATE("The object size is only estimated."), REPLACING_IN_NON_CHAR_OBJ("replacing substrings in a non-character object"), - FILE_NOT_FOUND_IN_ZIP("requested file not found in the zip file"); + FILE_NOT_FOUND_IN_ZIP("requested file not found in the zip file"), + LIST_NO_VALID_NAMES("list argument has no valid names"); public final String message; final boolean hasArgs; 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 d4e5866c55bc2de89d8557ce4f0f07e621501872..894ba059c4f6f3a33d501b2b69f62e786ca2f02c 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 @@ -6356,7 +6356,7 @@ q1.csv 0.8333333 0.5000000 0.1666667 q2.csv 1.0000000 0.6666667 0.0000000 q3.csv 0.3333333 0.6666667 0.5000000 -##com.oracle.truffle.r.test.builtins.TestBuiltin_asdataframetable.testasdataframetable1#Ignored.ImplementationError# +##com.oracle.truffle.r.test.builtins.TestBuiltin_asdataframetable.testasdataframetable1# #argv <- structure(list(x = structure(integer(0), .Dim = 0L, .Dimnames = structure(list(NULL), .Names = ''), class = 'table')), .Names = 'x');do.call('as.data.frame.table', argv) [1] Freq <0 rows> (or 0-length row.names) @@ -38469,7 +38469,7 @@ NULL #argv <- list(list(), NULL);`oldClass<-`(argv[[1]],argv[[2]]); list() -##com.oracle.truffle.r.test.builtins.TestBuiltin_oldClassassign.testoldClassassign2#Ignored.ImplementationError# +##com.oracle.truffle.r.test.builtins.TestBuiltin_oldClassassign.testoldClassassign2# #argv <- list(NULL, NULL);`oldClass<-`(argv[[1]],argv[[2]]); NULL @@ -43432,7 +43432,7 @@ Error in options(NA) : invalid argument ##com.oracle.truffle.r.test.builtins.TestBuiltin_options.testoptions5#Ignored.ReferenceError# #options(NULL); -##com.oracle.truffle.r.test.builtins.TestBuiltin_options.testoptions5#Ignored.Unimplemented# +##com.oracle.truffle.r.test.builtins.TestBuiltin_options.testoptions5# #options(list(NULL)); Error in options(list(NULL)) : list argument has no valid names diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_asdataframetable.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_asdataframetable.java index 5f84f74b06ebfe6abca15e6b36332a195d46562b..a36c934765502ab1c136381850cd5e8465e5d14f 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_asdataframetable.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_asdataframetable.java @@ -20,8 +20,7 @@ public class TestBuiltin_asdataframetable extends TestBase { @Test public void testasdataframetable1() { - // FIXME ClassCastException: RNull cannot be cast to RStringVector - assertEval(Ignored.ImplementationError, "argv <- structure(list(x = structure(integer(0), .Dim = 0L, .Dimnames = structure(list(NULL), .Names = ''), class = 'table')), .Names = 'x');" + + assertEval("argv <- structure(list(x = structure(integer(0), .Dim = 0L, .Dimnames = structure(list(NULL), .Names = ''), class = 'table')), .Names = 'x');" + "do.call('as.data.frame.table', argv)"); } } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_oldClassassign.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_oldClassassign.java index a971a63a5d66142a2a4ade582716af32d1750dce..63f8e4dcd346094493532aa633d67b1e793b818c 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_oldClassassign.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_oldClassassign.java @@ -23,9 +23,7 @@ public class TestBuiltin_oldClassassign extends TestBase { @Test public void testoldClassassign2() { - // FIXME UnsupportedSpecializationException: Unexpected values provided for oldClass<-: [], - // [] - assertEval(Ignored.ImplementationError, "argv <- list(NULL, NULL);`oldClass<-`(argv[[1]],argv[[2]]);"); + assertEval("argv <- list(NULL, NULL);`oldClass<-`(argv[[1]],argv[[2]]);"); } @Test diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_options.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_options.java index 56452811e63d7ed88fd07b0df14c9ee90b3d83bb..97b6fd5ca14a135fd97d82c11f6cbb9879929d9e 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_options.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/builtins/TestBuiltin_options.java @@ -39,8 +39,7 @@ public class TestBuiltin_options extends TestBase { @Test public void testoptions5() { - // FIXME RInternalError: should not reach here - assertEval(Ignored.Unimplemented, "options(list(NULL));"); + assertEval("options(list(NULL));"); assertEval("options(NA);"); // IMHO ReferenceError since NULL makes little sense as parameter value // here just like NA which outputs 'invalid argument' both in GnuR and FastR.