From 1a2799787558ceedac46510f1c869c3f31741d34 Mon Sep 17 00:00:00 2001
From: Adam Welc <adam.welc@oracle.com>
Date: Tue, 6 Dec 2016 16:25:57 -0800
Subject: [PATCH] Minor S4 fix.

---
 .../src/com/oracle/truffle/r/runtime/RType.java               | 4 ++--
 .../src/com/oracle/truffle/r/test/ExpectedTestOutput.test     | 4 ++++
 .../src/com/oracle/truffle/r/test/S4/TestS4.java              | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

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 fe0a57bac5..9ee98c9d78 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 411da557d8..76c8bddc74 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 41a29e7c30..30a6d6d91d 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
-- 
GitLab