evalEmpire/method-signatures

Multi-line defaults are broken

Closed this issue · 1 comments

use Method::Signatures;

func whatever(
    $arg = { this => 23,
             that => 42,
           }
) {
    return $arg->{that};
}

print whatever();
syntax error at /Users/schwern/tmp/test.plx line 5, near "}"
Missing right curly or square bracket at /Users/schwern/tmp/test.plx line 7, at end of line
Execution of /Users/schwern/tmp/test.plx aborted due to compilation errors.

This is because Devel::Declare::set_linestr cannot inject a line with newlines in it. Perl ignores the code after the newline.

Fixed by #107 and merged.