=head2 C<type_constraint $class>
-Find the type constraint for C<$class> by loading the relevant F<.pm> file beforehand.
+Find the type constraint for C<$class> by first trying to load the relevant F<.pm> file.
=cut
my $file = $class;
$file =~ s{::}{/}g;
$file .= '.pm';
- require $file;
+ unless ($INC{$file}) {
+ local $@;
+ eval {
+ local $SIG{__DIE__}; # See LaTeX::TikZ::Meta::TypeConstraint::Autocoerce
+ require $file;
+ }
+ }
find_type_constraint($class);
}