Project

General

Profile

« Previous | Next » 

Revision 2e551356

Added by jeremyevans (Jeremy Evans) over 4 years ago

Make Kernel#{Pathname,BigDecimal,Complex} return argument if given correct type

This is how Kernel#{Array,String,Float,Integer,Hash,Rational} work.
BigDecimal and Complex instances are always frozen, so this should
not cause backwards compatibility issues for those. Pathname
instances are not frozen, so potentially this could cause backwards
compatibility issues by not returning a new object.

Based on a patch from Joshua Ballanco, some minor changes by me.

Fixes [Bug #7522]