# New Ticket Created by  mt1957 
# Please include the string:  [perl #131493]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131493 >


Hi,

In Rakudo version 2017.05-338-gaca1929 built on MoarVM version 
2017.05-25-g62bc54e
implementing Perl 6.c I saw that a type could be changed through an 
assignment which It should not do. In REPL;


 > my Str $s = IntStr.new(12,'12');
12
 > $s.WHAT
(IntStr)
 >

The type IntStr should be coerced into Str. A second example happened in 
my code and golfed in REPL



 > sub s (Str :$str) {say $str.WHAT}
sub s (Str :$str) { #`(Sub|89412592) ... }
 > s(:str<1>)
(IntStr)
 > s(:str<a>)
(Str)


The type should stay as it was defined I think.
Marcel

Reply via email to