Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state variable not initialized in some multi subs #5856

Open
p6rt opened this issue Dec 4, 2016 · 1 comment
Open

state variable not initialized in some multi subs #5856

p6rt opened this issue Dec 4, 2016 · 1 comment
Labels

Comments

@p6rt
Copy link

@p6rt p6rt commented Dec 4, 2016

Migrated from rt.perl.org#130257 (status was 'new')

Searchable as RT130257$

@p6rt
Copy link
Author

@p6rt p6rt commented Dec 4, 2016

From @mscha

In this example, the state variable appears not to be initialized​:

  multi sub foo(Int $x where 1..10)
  {
  state $bar = 42;
  say $bar;
  }

  foo(3); # Output​: (Any)

When you remove the "where 1..10" clause, it works fine. Or
alternatively, remove the "multi" and it works fine as well.

Using Rakudo Star 2016.11​:
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant