| ugexe | m: my %h; %h<a> = 1; say %h.keys.head.WHAT | 01:58 | |
| camelia | (Str) | ||
| ugexe | why does that get to be a Str but | ||
| m: my Str $x = <1>; say $x.WHAT | |||
| camelia | (IntStr) | ||
| ugexe | that has to be an IntStr | ||
| i guess because it just coerces everything to str | 02:00 | ||
| it would be nice if `my Int $y = 0; my Str $x = $y;` could be a compile time error, but it can't because of allomorphs | |||
| which is sad because that being a compile time error is way more useful than not having to explicitly coerce env variables or main params to the expected type | 02:01 | ||
| japhb | m: my Int $y = 0; my Str $x = $y; dd $x, $y; | 02:34 | |
| camelia | Type check failed in assignment to $x; expected Str but got Int (0) in block <unit> at <tmp> line 1 |
||
| japhb | ugexe: I'm guessing you meant `my Int $y = <0>` ? | 02:35 |