0,
lt_hash);
#else
- SV **val = hv_fetch(GvHV(PL_hintgv), __PACKAGE__, __PACKAGE_LEN__, lt_hash);
+ SV **val = hv_fetch(GvHV(PL_hintgv), __PACKAGE__, __PACKAGE_LEN__, 0);
if (!val)
return 0;
hint = *val;
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+{
+ local %^H = (a => 1);
+
+ require Lexical::Types;
+
+ my $err = do {
+ local $@;
+ eval <<' VIVIFICATION_TEST';
+ package Lexical::Types::TestVivification;
+ sub TYPEDSCALAR { }
+ my Lexical::Types::TestVivification $lexical;
+ VIVIFICATION_TEST
+ $@;
+ };
+
+ # Force %^H repopulation with an Unicode match
+ my $x = "foo";
+ utf8::upgrade($x);
+ $x =~ /foo/i;
+
+ my $hints = join ',',
+ map { $_, defined $^H{$_} ? $^H{$_} : '(undef)' }
+ sort keys(%^H);
+ is $err, '', 'vivification test code did not croak';
+ is $hints, 'a,1', 'Lexical::Types does not vivify entries in %^H';
+}