[perl #132980] Coercion type apparently does not check the actual type of the coerced value

2018-06-17 Thread Zoffix Znet via RT
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 )

[perl #132980] Coercion type apparently does not check the actual type of the coerced value

2018-06-17 Thread Zoffix Znet via RT
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 )

[perl #132980] Coercion type apparently does not check the actual type of the coerced value

2018-03-14 Thread Zoffix Znet via RT
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

[perl #132980] Coercion type apparently does not check the actual type of the coerced value

2018-03-14 Thread Zoffix Znet via RT
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

[perl #132980] Coercion type apparently does not check the actual type of the coerced value

2018-03-14 Thread brian d foy
# 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