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

Inline coerce warnings: Found = in conditional, should be == #24

Closed
zitsen opened this issue Apr 21, 2015 · 2 comments
Closed

Inline coerce warnings: Found = in conditional, should be == #24

zitsen opened this issue Apr 21, 2015 · 2 comments

Comments

@zitsen
Copy link

zitsen commented Apr 21, 2015

I'm using inlined coercions in Mandel.

Using Perl 5.18.2 on Ubuntu 14.04, it causes warnings while coercing type Dict.

Found = in conditional, should be ==

This test show the warning:

use strict;
use warnings;
use Types::Standard -all;
my $value = { key => 'value' };
my $type = Dict[key => Str];

eval $type->coercion->inline_coercion('$value');

I've print out the inlined code, seems the warning caused here:

($new{"key"}=$tmp) : ($return_orig=1 and last DICTLABEL1)

Till now, I have to disable warnings when eval the inlined code. Would you fix it?

@robrwo
Copy link
Contributor

robrwo commented May 5, 2015

+1

@tobyink
Copy link
Owner

tobyink commented May 7, 2015

Generally speaking, Type::Tiny does evaluate the code in a sandbox where strict is enabled but warnings are not.

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

3 participants