Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures for Type::Params on earlier Perls #8

Closed
cxw42 opened this issue Sep 14, 2019 · 1 comment
Closed

Test failures for Type::Params on earlier Perls #8

cxw42 opened this issue Sep 14, 2019 · 1 comment

Comments

@cxw42
Copy link
Owner

cxw42 commented Sep 14, 2019

E.g., http://www.cpantesters.org/cpan/report/f9110536-d535-11e9-9066-e374b0ba08e8 .

The package variables are undef at the time they are used.

@cxw42 cxw42 closed this as completed in f84f3b8 Sep 14, 2019
@cxw42
Copy link
Owner Author

cxw42 commented Sep 14, 2019

The deal was that local @_ was interacting badly with goto &$candidate. Apparently on newer Perls the local @_ wasn't being reverted, or the guard was living through the invocation of $candidate, so everything worked. However, older Perls took seriously perldoc's admonition that goto "los[es] any changes set by local". Therefore, the guard was being called and resetting the package variables before $candidate could run. Removing the local did the job!

Also, for the record, whenever you use a ternary, make sure it has parens before it. The failures in http://www.cpantesters.org/cpan/report/9be5b5be-d648-11e9-99fe-b031dbec7dbf were because

sub foo { }
diag foo ? 'bar' : 'bat';
...
diag foo ? 'baz' : 'quux';

can be interpreted as diag(foo(? 'bar' ... foo ? ...)), where the ?...? is an m?? construct without leading m (prohibited in 5.22+ - https://metacpan.org/pod/Syntax::Construct#??).

cxw42 added a commit that referenced this issue Sep 20, 2019
Changelog diff is:

diff --git i/Changes w/Changes
index 1c451f4..1ccfc94 100644
--- i/Changes
+++ w/Changes
@@ -2,6 +2,14 @@ Revision history for Perl extension Sub-Multi-Tiny

 {{$NEXT}}

+0.000010 2019-09-20T02:36:46Z (TRIAL RELEASE)
+
+    - Add tests
+    - Refactor out common test code
+    - In D:Default, die loudly on type or where checks, rather
+      than ignoring them silently.
+    - Update documentation
+
 0.000009 2019-09-14T02:28:08Z (TRIAL RELEASE)

     - Fix Dispatcher::TypeParams to run on older Perls (#8)
@@ -50,3 +58,4 @@ Revision history for Perl extension Sub-Multi-Tiny

     - Initial release to CPAN.  Only supports dispatch by arity.

+# vi: set ts=4 sts=4 sw=4 et ai: #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant