Skip Menu |
Report information
Id: 127443
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: raiph <raiph.mellor [at] gmail.com>
Cc:
AdminCc:

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



Subject: Binding / bound variables don't honor binder variable's type constraint
Download (untitled) / with headers
text/plain 743b
Reporting an apparent bug pointed out by Christoph at http://stackoverflow.com/a/35002979/1077672 This is Rakudo version 2015.12-213-g770d109 built on MoarVM version 2015.12-29-g8079ca5 implementing Perl 6.c. What I did ========== my Int $a; my $b = 42; $a := $b; $b = "not Int"; say $a; $a = "not Int"; say $a; $a := "not Int"; What I got ========== not cool not cool Type check failed in binding; expected Int but got Str in block <unit> at -e line 1 What I "expected" ================= That $b's type constraints have to be the same as or more narrow than $a's type constraints for the binding `$a := $b` to succeed. So something like: ===SORRY!=== Error while compiling ... Type check failed in binding; expected Int but got Mu
Download (untitled) / with headers
text/plain 134b
What I got ========== Should of course have been: not Int not Int Type check failed in binding; expected Int but got Str ("not Int")
Still present in today's Rakudo fa84f1 -- Cheers, ZZ | https://twitter.com/zoffix


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