Skip to content

Incorrect error message when BigDecimal fails to coerce during comparison #2539

@undefinedvalue

Description

@undefinedvalue

When attempting to compare a BigDecimal to an object that does not implement #coerce, the error message incorrectly indicates that the object is nil and the message has a typo.

> 10.to_d < "foo"
nil could not be coerced to BigDecmil

("BigDecmil" is a typo in the code)
https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java#L944

A correct message might be: "String can't be coerced into BigDecimal"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions