Skip to content

Commit 795d6a1

Browse files
committed
[Truffle] Adding RubyString handling to attr_accesor.
1 parent 75fe358 commit 795d6a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

truffle/src/main/java/org/jruby/truffle/nodes/core/ModuleNodes.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,10 @@ public RubyNilClass attrAccessor(RubyModule module, Object[] args) {
509509

510510
if (arg instanceof RubySymbol) {
511511
accessorName = ((RubySymbol) arg).toString();
512+
} else if (arg instanceof RubyString) {
513+
accessorName = ((RubyString) arg).toString();
512514
} else {
513-
throw new UnsupportedOperationException();
515+
throw new RaiseException(getContext().getCoreLibrary().typeError(" is not a symbol or string", this));
514516
}
515517

516518
attrAccessor(this, getContext(), sourceSection, module, accessorName);

0 commit comments

Comments
 (0)