From: Jesse Luehrs <doy@tozt.net>
Date: Sun, 24 Apr 2011 22:35:19 +0000 (-0500)
Subject: require Devel::PartialDump 0.14, to avoid infinite loop bug
X-Git-Tag: 2.0002~8
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ebff10df9170ab53257e8097ecc80232c12b82f8;p=gitmo%2FMoose.git

require Devel::PartialDump 0.14, to avoid infinite loop bug
---

diff --git a/dist.ini b/dist.ini
index 6894c35..bf0fdf0 100644
--- a/dist.ini
+++ b/dist.ini
@@ -105,7 +105,7 @@ URI                          = 0
 [Prereqs / RuntimeRecommends]
 ; this needs to be installed *after*, since it deps on Moose
 ; remove this if this is an issue
-Devel::PartialDump = 0
+Devel::PartialDump = 0.14
 
 [Conflicts]
 -script = bin/moose-outdated
diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm
index f85cffb..0c35333 100644
--- a/lib/Moose/Meta/TypeConstraint.pm
+++ b/lib/Moose/Meta/TypeConstraint.pm
@@ -140,7 +140,12 @@ sub get_message {
     }
     else {
         # have to load it late like this, since it uses Moose itself
-        if (try { Class::MOP::load_class('Devel::PartialDump'); 1 }) {
+        my $can_partialdump = try {
+            # versions prior to 0.14 had a potential infinite loop bug
+            Class::MOP::load_class('Devel::PartialDump', { -version => 0.14 });
+            1;
+        };
+        if ($can_partialdump) {
             $value = Devel::PartialDump->new->dump($value);
         }
         else {