Fix RT bug #43151 where _-> completion had error
Chris Marshall [Sat, 12 Jun 2010 16:35:13 +0000 (12:35 -0400)]
The problem was actually the FindVariable plugin implementation
of find_variable.  Class::MOP::Package::has_package_symbol method
was being called with a name without a sigil which is an error
in usage.  This skips the call if no sigil is present.

lib/Devel/REPL/Plugin/FindVariable.pm

index 9c06906..69a746c 100644 (file)
@@ -23,7 +23,8 @@ sub find_variable {
 
     my $meta = Class::MOP::Class->initialize($package);
 
-    return unless $meta->has_package_symbol("$sigil$name");
+    # Class::MOP::Package::has_package_symbol method *requires* a sigil
+    return unless length($sigil) and $meta->has_package_symbol("$sigil$name");
     $meta->get_package_symbol("$sigil$name");
 }