Project

General

Profile

Feature #13984

BigDecimal should be immutable/frozen and return itself on #dup

Added by Eregon (Benoit Daloze) almost 2 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:83168]

Description

Currently, BigDecimal instances are not frozen, and supports #dup by returning a new instance.

In the spirit of #12979 and #13983, I think BigDecimal instances should always be frozen.
Then BigDecimal#dup/clone should just return the same instance.


Related issues

Related to Ruby master - Feature #13985: Avoid exception for #dup/#clone on Rational and ComplexClosedActions

History

#1

Updated by Eregon (Benoit Daloze) almost 2 years ago

  • Related to Feature #13985: Avoid exception for #dup/#clone on Rational and Complex added

Updated by hsbt (Hiroshi SHIBATA) almost 2 years ago

  • Assignee set to mrkn (Kenta Murata)
  • Status changed from Open to Assigned

Updated by mrkn (Kenta Murata) over 1 year ago

I decided to make a BigDecimal is frozen and remove dup-support.
But it introduces incompatibilities, so during Ruby 2.5 period, I'll make them deprecated and issue warning messages.

#5

Updated by mrkn (Kenta Murata) over 1 year ago

  • Target version set to 2.6
#6

Updated by naruse (Yui NARUSE) over 1 year ago

  • Target version deleted (2.6)

Updated by mrkn (Kenta Murata) 9 months ago

  • Status changed from Assigned to Closed

Fixed in r66222

Also available in: Atom PDF