From 285ffa463c8939d6b6a0461463c6a323aa594a3a Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Thu, 28 Aug 2014 18:26:41 -0400 Subject: [PATCH] okay, dam@cpan.org's fix for using not using ->usa('UNIVERSAL') to test if something loaded apparently works in a situation where mine doesn't, that was causing tests to fail. --- lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm index 4acf83b..bb21347 100644 --- a/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm +++ b/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm @@ -7,6 +7,7 @@ use SOAP::WSDL::XSD::Typelib::Builtin; use Scalar::Util qw(blessed); use Data::Dumper; require Class::Std::Fast::Storable; +use Class::Load (); use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType); @@ -155,9 +156,10 @@ sub _factory { my $type = $CLASSES_OF{ $class }->{ $name } or croak "No class given for $name"; - $type->can('serialize') - or eval "require $type" - or croak $@; + # require all types here + Class::Load::is_class_loaded($type) + or eval { Class::Load::load_class $type } + or croak $@; # check now, so we don't need to do it later. # $is_list is used in the methods created. Filling it now means