# New Ticket Created by  Siddhant Saraf 
# Please include the string:  [perl #113816]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=113816 >


1. <sisar> r: my Bool $x; say $x++;
<p6eval> rakudo 3a0e40: OUTPUT«Type check failed in assignment to
'$x'; expected 'Bool' but got 'Int'␤  in sub postfix:<++> at
src/gen/CORE.setting:1342␤  in block <anon> at /tmp/yS4FLnf7uE:1␤␤»

Expected output: True

2. <sisar> r: my Bool $x; say --$x;
<p6eval> rakudo 3a0e40: OUTPUT«Type check failed in assignment to
'$x'; expected 'Bool' but got 'Int'␤  in sub prefix:<--> at
src/gen/CORE.setting:1338␤  in block <anon> at /tmp/ripRnRlVUe:1␤␤»

Expected output: False

S03:539 covers postfix:<++> on Bools. (just before postfix:<++> on
Any/Numeric/Cool is described)

Also:
<sisar> pmichaud: note that the bug only occurs when $x is
uninitialized. The spec is silent(?) on incrementing uninitialized
Bool variables.
<pmichaud> sisar: I'm expecting uninitialized Bool to work like
uninitialized Numeric
<pmichaud> principle of least surprise :)

Reply via email to