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

Subset accesses always match string indexes exactly.

parent 98e08697
Branches
No related tags found
No related merge requests found
......@@ -217,11 +217,11 @@ public class InfixEmulationFunctions {
protected final ConditionProfile multiIndexProfile = ConditionProfile.createBinaryProfile();
protected Object getInternal(VirtualFrame frame, Object x, RArgsValuesAndNames inds, RAbstractLogicalVector dropVec) {
return access(frame, x, RRuntime.LOGICAL_FALSE, inds, dropVec, IS_SUBSET);
return access(frame, x, RRuntime.LOGICAL_TRUE, inds, dropVec, IS_SUBSET);
}
protected Object getInternal(VirtualFrame frame, Object x, RArgsValuesAndNames inds, RMissing dropVec) {
return access(frame, x, RRuntime.LOGICAL_FALSE, inds, dropVec, IS_SUBSET);
return access(frame, x, RRuntime.LOGICAL_TRUE, inds, dropVec, IS_SUBSET);
}
@SuppressWarnings("unused")
......
......@@ -269,6 +269,7 @@ public class TestSimpleVectors extends TestBase {
assertEval("{ x<-c(TRUE,TRUE,FALSE); x[2L] }");
assertEval("{ x<-c(TRUE,TRUE,FALSE); x[3L] }");
assertEval("{ v<-c(a=\"foo\", aa=\"me\"); v[\"a\"] }");
assertEval("{ x<-c(1,2); x[c(\"a\")] }");
assertEval(Output.ContainsError, "{ x<-c(1,2); x[[c(\"a\")]] }");
assertEval("{ x<-c(1,2); dim(x)<-c(1,2); x[c(\"a\")] }");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment