Args() started parsing as Args('') instead of Args, which in
DispatchType::Chained->list's debugging output ends up causing the
equivalent of this to run:
("*") x ~0
The result is Perl throwing an "Out of memory during list extend" error.
Fix to follow.
NB: Using the normalized_arg_number (where ~0 stands in for ∞) for this
debugging output is dubious, but there's not a clear cut revert as the
changes which got us there are spread across multiple commits related to
the new typed Args support. I'm saving any change to the use of
normalized_arg_number and list_extra_info for another time (and probably
another person), in favor of changing the least while fixing both the
Args() regression and the original Path() bug which precipitated it.
--- /dev/null
+use warnings;
+use strict;
+use Test::More;
+use FindBin qw< $Bin >;
+use lib "$Bin/lib";
+use constant App => 'TestAppArgsEmptyParens';
+use Catalyst::Test App;
+
+{
+ my $res = request('/chain_base/args/foo/bar');
+ is $res->content, 'Args', "request '/chain_base/args/foo/bar'";
+}
+
+{
+ my $res = request('/chain_base/args_empty/foo/bar');
+ is $res->content, 'Args()', "request '/chain_base/args_empty/foo/bar'";
+}
+
+eval { App->dispatcher->dispatch_type('Chained')->list(App) };
+ok !$@, "didn't die"
+ or diag "Died with: $@";
+like $TestLogger::LOGS[-1], qr{/args\s*\Q(...)\E};
+like $TestLogger::LOGS[-1], qr{/args_empty\s*\Q(...)\E};
+
+done_testing;
+
+__END__
+
--- /dev/null
+package TestAppArgsEmptyParens::Controller::Root;
+use Moose;
+use MooseX::MethodAttributes;
+
+extends 'Catalyst::Controller';
+
+sub chain_base :Chained(/) PathPart('chain_base') CaptureArgs(0) { }
+
+ sub args : Chained(chain_base) PathPart('args') Args { $_[1]->res->body('Args') }
+ sub args_empty : Chained(chain_base) PathPart('args_empty') Args() { $_[1]->res->body('Args()') }
+
+TestAppArgsEmptyParens::Controller::Root->config(namespace=>'');
+
+package TestAppArgsEmptyParens;
+use Catalyst;
+use TestLogger;
+
+TestAppArgsEmptyParens->setup;
+TestAppArgsEmptyParens->log( TestLogger->new );
+
+1;