# New Ticket Created by  "Kyle Hasselbacher" 
# Please include the string:  [perl #67058]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67058 >


I discovered this while trying to write a test for another bug report.
 Here's the minimal test, which I'll put in
pugs/t/spec/S04-declarations/state-rtXXXXX.t once I get a number back
from this bug report.

use v6;

use Test;

plan 1;

sub bughunt1 { (state $svar) }
{
    sub bughunt2 { state $x //= 17; $x++ }
    #?rakudo todo 'b0rk'
    lives_ok { bughunt2() },
        'a state variable in parens lives with a state variable with //= init';
}

I've tried removing pretty much every part of this test case, and it's
all necessary.

* state $svar in parens in bughunt1.
* braces around bughunt2 definition.
* Assignment and modification of $x
* call to bughunt2

Reply via email to