Re-opening this, as there's a much more common case where a typecheck of the
coercion result would be desired and that's when coercion results in a Failure:
m: multi sub foo(Int() $) { }; foo Inf
rakudo-moar 5a6ff4073: ( no output )
Re-opening this, as there's a much more common case where a typecheck of the
coercion result would be desired and that's when coercion results in a Failure:
m: multi sub foo(Int() $) { }; foo Inf
rakudo-moar 5a6ff4073: ( no output )
On Wed, 14 Mar 2018 14:16:06 -0700, comdog wrote:
> I was playing with coercion types and wondered what would happen if
> a .Int method did not return the right sort of type:
>
> class Foo {
> method Int ( --> Str ) { 'Hello' }
> }
>
> put try-it( Foo.new );
>
> sub
On Wed, 14 Mar 2018 14:16:06 -0700, comdog wrote:
> I was playing with coercion types and wondered what would happen if
> a .Int method did not return the right sort of type:
>
> class Foo {
> method Int ( --> Str ) { 'Hello' }
> }
>
> put try-it( Foo.new );
>
> sub
# New Ticket Created by "brian d foy"
# Please include the string: [perl #132980]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=132980 >
I was playing with coercion types and wondered what would happen if
a .Int method did