Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
constants and subs of the same name (RT #69522)
  • Loading branch information
moritz committed Oct 1, 2011
1 parent 104edee commit 6875b22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions S04-declarations/constant.t
Expand Up @@ -14,6 +14,14 @@ use Test;
dies_ok { foo = 3 }, "can't reassign to a sigil-less constant";
}

{
# RT #69522
sub foo { "OH NOES" };
constant foo = 5;
is foo, 5, 'bare constant wins against sub of the same name';
is foo(), 'OH NOES', '... but parens always indicate a sub call';
}

{
my $ok;

Expand Down

0 comments on commit 6875b22

Please sign in to comment.