Need to use around to fake class style inheritance in a role, yuck
David Leadbeater [Tue, 11 Jan 2011 22:34:11 +0000 (22:34 +0000)]
Note these commits need the changes I just pushed to Moo.git
people/dg/compose to work.

lib/Eval/WithLexicals/WithHintPersistence.pm

index 92d5e77..de3f76b 100644 (file)
@@ -41,7 +41,8 @@ sub _capture_unroll_global {
   );
 }
 
-sub setup_code {
+around setup_code => sub {
+  shift; # we bypass orig, i.e. using role as normal inheritance.
   my($self) = @_;
   # Only run the prelude on the first eval, hints will be set after
   # that.