Skip Menu |
Report information
Id: 129089
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: allbery.b [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Thu, 25 Aug 2016 17:02:40 -0400
From: Brandon Allbery <allbery.b [...] gmail.com>
To: rakudobug [...] perl.org
Subject: [LTA] error for attempt to specify a "my" type at runtime doesn't say what went wrong
Download (untitled) / with headers
text/plain 1.1k
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
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org