Skip to content
Browse files

constants and subs of the same name (RT #69522)

  • Loading branch information...
1 parent 104edee commit 6875b2252a10d178b560caf94df008f871cff76f @moritz moritz committed Oct 1, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 S04-declarations/constant.t
View
8 S04-declarations/constant.t
@@ -15,6 +15,14 @@ use Test;
}
{
+ # 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;
constant $bar = 42;

0 comments on commit 6875b22

Please sign in to comment.
Something went wrong with that request. Please try again.