# New Ticket Created by   
# Please include the string:  [perl #129889]
# in the subject line of all future correspondence about this issue. 
# <URL: 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 <unit> 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 <unit> 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

Reply via email to