forked from evalEmpire/method-signatures
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed a bizarre error hiding condition
turned out to be necessary to localize $@ in Parser::split_proto() also finally came up with a test case which demonstrates the error
- Loading branch information
1 parent
8b370c5
commit e0cd9bc
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use lib 't/lib'; | ||
|
||
use Test::More; | ||
use Test::Exception; | ||
|
||
|
||
throws_ok { require BarfyDie } qr/requires explicit package name/, "MS doesn't interrupt real compilation error"; | ||
|
||
|
||
done_testing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; |