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
Special case allomorph coercion everywhere #6322
Comments
From @zoffixznet(found in discussion in https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131493 ) We have some special casing for coercion of allomorphs in some instances, which <Zoffix__> m: <1>.Str.^name.say However, allomorphs don't get coerced with parameter coercers and possibly some <Zoffix__> m: -> Str() $_ { .^name.say }(<1>) So the question becomes: do we special case allomorphs everywhere? - If yes, any place we special case them will have a caveat and surprising behaviour |
From @cokeOn Sat, 03 Jun 2017 21:20:49 -0700, cpan@zoffix.com wrote:
No. The current behavior seems correct to me.
If you want something coerced to the exact type, this can be done outside of the signature. I would just document the behavior for coercions clearly, in that if the value already satisfy the type in the coercer, your value is passed through unchanged.
-- |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#131505 (status was 'open')
Searchable as RT131505$
The text was updated successfully, but these errors were encountered: