# New Ticket Created by Brandon Allbery # Please include the string: [perl #129089] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=129089 >
Someone in IRC last night was trying to figure out how to specify a variable's type at runtime. [25 03:18] <avuserow_> m: my Int $foo = 999; my $t = int8; say (my $t $ = $foo); # can I do the type indirectly? [25 03:18] <camelia> rakudo-moar 547fc5: OUTPUT«===SORRY!=== [25 03:18] Two terms in a row [25 03:18] at <tmp>:1 [25 03:18] ------> Int $foo = 999; my $t = int8; say (my $t⏏ $ = $foo); # can I do the type indirect [25 03:18] expecting any of: [25 03:18] constraint [25 03:18] infix [25 03:18] infix stopper [25 03:18] postfix…» (...) [25 03:21] <geekosaur> m: my Int $foo = 999; BEGIN my $t = 'int8'; say (my ::($t) $ = $foo); [25 03:21] <camelia> rakudo-moar 547fc5: OUTPUT«X::TypeCheck::Assignment exception produced no message [25 03:21] in block <unit> at <tmp> line 1 [25 03:21]  [25 03:21] » It's fine if that's just not possible, but the error message is somewhat less than helpful. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net