Commit | Line | Data |
1a52f2db |
1 | #!perl |
2 | use strict; |
3 | use warnings FATAL => 'all'; |
4 | use Test::More tests => 2; |
5 | |
6 | { |
7 | package My::Obj; |
8 | use Function::Parameters qw(:strict); |
9 | method new () { |
10 | bless {}, $self; |
11 | } |
12 | method foo ( |
13 | $x, # the X |
14 | $y, # the Y |
15 | ) { |
16 | return $x * $y; |
17 | } |
18 | my $bar = method ( |
19 | $P, # comment |
20 | $Q, # comment |
21 | ) { # comment |
22 | $P + $Q |
23 | }; |
24 | } |
25 | |
26 | my $o = My::Obj->new; |
27 | is $o->foo(4, 5), 20, "should allow comments and newlines in proto"; |
28 | is __LINE__, 28, "should leave line number intact"; |
29 | |
30 | __END__ |