# New Ticket Created by Hojung Yoon # Please include the string: [perl #64042] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=64042 >
"my Type $a" doesn't constraint, while "my $a of Type" does constraint. ================================== > my Int $foo = "string"; Type mismatch in assignment. > my $bar of Int = "string"; say $bar.WHAT Str > my Int $foo; my $bar of Int; say ~($foo.WHAT, $bar.WHAT) Int Failure ================================== <amoc> perl6: my Int $n = "str"; <p6eval> rakudo 627b6d: OUTPUT«Type mismatch in assignment.current instr.: 'die' pc 15868 (src/builtins/control.pir:204)» <amoc> perl6: my $n of Int = "str"; say $n.WHAT <p6eval> rakudo 627b6d: OUTPUT«Str» <amoc> perl6: my Int $foo; my $bar of Int; say ~($foo.WHAT, $bar.WHAT) <p6eval> rakudo 627b6d: OUTPUT«Int Failure»