Project

General

Profile

Actions

Feature #13984

closed

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

Added by Eregon (Benoit Daloze) almost 5 years ago. Updated almost 4 years 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 1 (0 open1 closed)

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

Updated by Eregon (Benoit Daloze) almost 5 years ago

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

Updated by hsbt (Hiroshi SHIBATA) almost 5 years ago

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

Updated by mrkn (Kenta Murata) almost 5 years 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.

Actions #5

Updated by mrkn (Kenta Murata) almost 5 years ago

  • Target version set to 2.6
Actions #6

Updated by naruse (Yui NARUSE) almost 5 years ago

  • Target version deleted (2.6)

Updated by mrkn (Kenta Murata) almost 4 years ago

  • Status changed from Assigned to Closed

Fixed in r66222

Actions

Also available in: Atom PDF