Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Original file line number Diff line number Diff line change
@@ -506,7 +506,7 @@ public Object eval(RubyString source, RubyBinding binding) {
}

@Specialization(guards = "!isString")
public Object eval(VirtualFrame frame, RubyBasicObject object, UndefinedPlaceholder binding) {
public Object eval(VirtualFrame frame, RubyBasicObject object, @SuppressWarnings("unused") UndefinedPlaceholder binding) {
notDesignedForCompilation();

Object coerced;
@@ -527,18 +527,12 @@ public Object eval(VirtualFrame frame, RubyBasicObject object, UndefinedPlacehol
if (coerced instanceof RubyString) {
return getContext().eval(coerced.toString(), this);
} else {
String coercedClassName = coerced.getClass().getName();

if (coerced instanceof RubyBasicObject) {
coercedClassName = ((RubyBasicObject) coerced).getLogicalClass().getName();
}

throw new RaiseException(
getContext().getCoreLibrary().typeError(
String.format("can't convert %s to String (%s#to_str gives %s)",
object.getLogicalClass().getName(),
object.getLogicalClass().getName(),
coercedClassName),
getContext().getCoreLibrary().getLogicalClass(coerced).getName()),
this));
}
}

0 comments on commit c1bf2b6

Please sign in to comment.