Re: [perl #129889] [BUG] Constraint type check failed for Array parameter

2016-10-16 Thread Parrot Raiser
FWIW, that's true on 2016.07.01 as well. build-date = 2016-07-22T12:37:00Z


[perl #129889] [BUG] Constraint type check failed for Array parameter

2016-10-15 Thread via RT
# New Ticket Created by   
# Please include the string:  [perl #129889]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=129889 >


This works OK (copied from https://docs.perl6.org/language/list#Typing):
 perl6 -e 'sub mean(Int @a) {@a.sum / @a.elems} ; my Int @b = 1, 3, 
5; say mean(@b);'

These do not:
 % perl6 -e 'sub mean(UInt @a) {@a.sum / @a.elems} ; my UInt @b = 1, 
3, 5; say mean(@b);'
 Constraint type check failed for parameter '@a'
   in sub mean at -e line 1
   in block  at -e line 1
 %
 % perl6 -e 'subset Data of UInt where * < 2**32 ; sub mean(Data @a) 
{@a.sum / @a.elems} ; my Data @b = 1, 3, 5; say mean(@b);'
 Constraint type check failed for parameter '@a'
   in sub mean at -e line 1
   in block  at -e line 1
 %


Environment:
 % perl6 --version
 This is Rakudo version 2016.06 built on MoarVM version 2016.06
 implementing Perl 6.c.
 % uname -a
 Linux host 4.7.0-1-amd64 #1 SMP Debian 4.7.5-1 (2016-09-26) x86_64 
GNU/Linux
 % dpkg-ck rakudo
 Desired=Unknown/Install/Remove/Purge/Hold
 | 
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
 |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
 ||/ Name Version
+++--===
 ii  rakudo 2016.06-1
 ii  rakudo-lib 2016.06-1