diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RType.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RType.java index fe0a57bac502c4d7f5fb31cd1a4cfe03f82e17c7..9ee98c9d78bcde430d2e58bc088703ab50ada1bf 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RType.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RType.java @@ -44,7 +44,7 @@ public enum RType { DefunctReal("real", -1), DefunctSingle("single", -1), ExternalPtr("externalptr", -1), - S4Object("s4object", -1), + S4Object("S4", -1), Connection("connection", -1), Dots("...", -1); @@ -160,7 +160,7 @@ public enum RType { return DefunctSingle; case "externalptr": return ExternalPtr; - case "s4object": + case "S4": return S4Object; case "connection": return Connection; 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 411da557d81edc47a44d8cbd349fda7e8e3d329f..76c8bddc7428a5191c70c57e1b93c00d7b8feb7d 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 @@ -120,6 +120,10 @@ Slot "j": [1] 42 +##com.oracle.truffle.r.test.S4.TestS4.testAllocation# +#{ setClass("foo", representation(j="numeric")); typeof(new("foo", j=42)) } +[1] "S4" + ##com.oracle.truffle.r.test.S4.TestS4.testClassCreation# #{ setClass("foo"); setClass("bar", representation(j = "numeric"), contains = "foo"); is.null(getClass("foo")@prototype) } [1] FALSE diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/S4/TestS4.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/S4/TestS4.java index 41a29e7c30c60c0d76f902975ed2a4fa92aba4e6..30a6d6d91d5452eaf144a3e67ac8336438ae1ee9 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/S4/TestS4.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/S4/TestS4.java @@ -85,7 +85,7 @@ public class TestS4 extends TestRBase { public void testAllocation() { assertEval("{ new(\"numeric\") }"); assertEval("{ setClass(\"foo\", representation(j=\"numeric\")); new(\"foo\", j=42) }"); - + assertEval("{ setClass(\"foo\", representation(j=\"numeric\")); typeof(new(\"foo\", j=42)) }"); } @Test