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

Fixed a problem with "class" function returning incorrect values for S4 objects.

parent ea30ff25
Branches
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ import com.oracle.truffle.r.runtime.data.model.*; ...@@ -21,7 +21,7 @@ import com.oracle.truffle.r.runtime.data.model.*;
@RBuiltin(name = "class", kind = PRIMITIVE, parameterNames = {"x"}) @RBuiltin(name = "class", kind = PRIMITIVE, parameterNames = {"x"})
public abstract class GetClass extends RBuiltinNode { public abstract class GetClass extends RBuiltinNode {
@Child private ClassHierarchyNode classHierarchy = ClassHierarchyNodeGen.create(true, true); @Child private ClassHierarchyNode classHierarchy = ClassHierarchyNodeGen.create(true, false);
@Specialization @Specialization
protected RAbstractStringVector getClass(Object x) { protected RAbstractStringVector getClass(Object x) {
......
...@@ -187,5 +187,7 @@ public class TestBuiltin_class extends TestBase { ...@@ -187,5 +187,7 @@ public class TestBuiltin_class extends TestBase {
assertEval("{x<-c(1,2,3);class(x)}"); assertEval("{x<-c(1,2,3);class(x)}");
assertEval("{x<-seq(1,10);class(x)}"); assertEval("{x<-seq(1,10);class(x)}");
assertEval("{ gen<-function(object) 0; setGeneric(\"gen\"); class(gen) }");
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment