File: BarfyDie.pm

package info (click to toggle)
libmethod-signatures-perl 20141021-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 620 kB
  • ctags: 133
  • sloc: perl: 3,561; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# For use with t/error_interruption.t

package BarfyDie;

use strict;
use warnings;

use Method::Signatures;


# This _should_ produce a simple error like the following:
# Global symbol "$foo" requires explicit package name at t/lib/BarfyDie.pm line 13.
$foo = 'hi!';

# And, without the signature below, it would.
# For that matter, if you compile this by itself, it still does.
# However, when you require this file from inside an eval, Method::Signature's parser() method will
# eat the error unless we localize $@ there.  So this verifies that we're doing that.

method foo (Str $bar)
{
}


1;