From: Dave Rolsky Date: Sat, 26 May 2012 21:52:47 +0000 (-0500) Subject: Make super() carp if you pass it arguments X-Git-Tag: 2.0800~47 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b99506c9285fa7ccfc4176e712d077b989e820e9;p=gitmo%2FMoose.git Make super() carp if you pass it arguments --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 568bdd7..121fc9a 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -5,10 +5,9 @@ use warnings; use 5.008; use Scalar::Util 'blessed'; -use Carp 'confess'; +use Carp 'carp', 'confess'; use Class::Load 'is_class_loaded'; - use Moose::Deprecated; use Moose::Exporter; @@ -90,6 +89,10 @@ our $SUPER_BODY; our @SUPER_ARGS; sub super { + if (@_) { + carp 'Arguments passed to super() are ignored'; + } + # This check avoids a recursion loop - see # t/bugs/super_recursion.t return if defined $SUPER_PACKAGE && $SUPER_PACKAGE ne caller();