From: Tomas Doran Date: Thu, 25 Aug 2011 08:29:33 +0000 (+0100) Subject: Name the type to make errors more obvious X-Git-Tag: 5.90003~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=eefb8bd16476a347ff5dc3a5abd188e5a5a520a4 Name the type to make errors more obvious --- diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index b34ceec..23a1d3f 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -45,9 +45,12 @@ has _response_cb => ( predicate => '_has_response_cb', ); +subtype 'Catalyst::Engine::Types::Writer', + as duck_type([qw(write close)]), + where { 1 }; has _writer => ( is => 'ro', - isa => duck_type([qw(write close)]), + isa => 'Catalyst::Engine::Types::Writer', writer => '_set_writer', clearer => '_clear_writer', );