moose/Moose — pull request #94 by mephinet (2014-12-28 21:19:52+00:00)
Title: Improve method modifier's wrapper name

At the moment, using method modifiers creates an anonymous sub that wraps the method. Thus, when a method modifier dies, the stacktrace contains only the generic `Class::MOP::Class:::after` (note the 3 colons) and the `__ANON__`, which doesn't help a lot in finding the triggering code.

I understand from the comment near `Class::MOP::Class::add_around_method_modifier` (currently here: https://github.com/moose/Moose/blob/master/lib/Class/MOP/Class.pm#L1114) , that the method modifier itself cannot be named sensibly as it can be applied multiple times to different methods. However, the wrapper function created by `Class::MOP::Method::Wrapped::wrap` is unique for each method and should not suffer this limitation.

Please take a look at the patch, whether you think it's a valuable improvement to the work done by @autarch in 9ef07cddf93c6834e04be77a19dca6baca09cec0... It doesn't add any new dependencies as `Sub::Name` is already required.