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 variables unset if multi candidate uses named params #6316

Open
p6rt opened this issue Jun 9, 2017 · 1 comment
Open

state variables unset if multi candidate uses named params #6316

p6rt opened this issue Jun 9, 2017 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 9, 2017

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

Searchable as RT131542$

@p6rt
Copy link
Author

p6rt commented Jun 9, 2017

From @zoffixznet

the `state $l` appears to break the moment we add an unrelated named param to it (doesn't happen with positionals)​:

<Zoffix> m​: class Foo { multi method foo (Int) { self.foo }; multi method foo(​:$foo) { state $l = 42; dd $l} }; Foo.new.foo​: 42;
<camelia> rakudo-moar f0c3bf​: OUTPUT​: «Any $l = Any␤»
<Zoffix> m​: class Foo { multi method foo (Int) { self.foo }; multi method foo() { state $l = 42; dd $l} }; Foo.new.foo​: 42;
<camelia> rakudo-moar f0c3bf​: OUTPUT​: «Int $l = 42␤»
<Zoffix> m​: class Foo { multi method foo (Int) { self.foo​: 'meow' }; multi method foo($foo) { state $l = 42; dd $l} }; Foo.new.foo​: 42;
<camelia> rakudo-moar f0c3bf​: OUTPUT​: «Int $l = 42␤»

@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