This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Test for a subtle pre-5.10 bug. Before 5.10 the overloading flag was
authorNicholas Clark <nick@ccl4.org>
Wed, 3 Oct 2007 20:34:13 +0000 (20:34 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 3 Oct 2007 20:34:13 +0000 (20:34 +0000)
commit2c615c57764e17cd374cd39caf4823ee12d15cbe
tree31f7bb4d130c4976d7f1c161c34c65522da1c796
parentc3c974a67f0c45348e2d8d31bc20ceb1672d9fa5
Test for a subtle pre-5.10 bug. Before 5.10 the overloading flag was
stored on the reference rather than the referent. Despite the fact that
objects can only be accessed via references (even internally), the
referent actually knows that it's blessed, not the references. So
taking a new, unrelated, reference to it gives an object. However, the
overloading-or-not flag was on the reference prior to 5.10, and taking
a new reference didn't (use to) copy it (prior to 5.8.9).
So test that the bug can't return - overloading should work on a
reference to something already blessed into a package with overloading.

p4raw-id: //depot/perl@32016
lib/overload.t