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

Rakudo silently ignores "my $!foo" variable declarations #1296

Closed
p6rt opened this issue Sep 19, 2009 · 5 comments
Closed

Rakudo silently ignores "my $!foo" variable declarations #1296

p6rt opened this issue Sep 19, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Sep 19, 2009

Migrated from rt.perl.org#69230 (status was 'resolved')

Searchable as RT69230$

@p6rt
Copy link
Author

p6rt commented Sep 19, 2009

From @carbin

The variable declaration should fail with an informative error message
rather than silently not assigning it (unless that is supposed to be
possible?)

class foo { method bar { my $!baz = 'lorem'; say $!baz; }; }; foo.bar;
No such attribute '$!baz'
in method foo​::bar (<unknown>​:1)

class foo { has $!baz = 'ipsum'; method bar { my $!baz = 'lorem'; say $!baz; }; }; my $foo = foo.new; $foo.bar;
ipsum

class foo { has $!baz; method bar { my $!baz = 'lorem'; say $!baz; }; }; my $foo = foo.new; $foo.bar;
Use of uninitialized value

--
Carlin

@p6rt
Copy link
Author

p6rt commented Jan 30, 2012

From @coke

On Fri Sep 18 21​:06​:23 2009, carlin wrote​:

The variable declaration should fail with an informative error message
rather than silently not assigning it (unless that is supposed to be
possible?)

class foo { method bar { my $!baz = 'lorem'; say $!baz; }; };
foo.bar;
No such attribute '$!baz'
in method foo​::bar (<unknown>​:1)

class foo { has $!baz = 'ipsum'; method bar { my $!baz = 'lorem';
say $!baz; }; }; my $foo = foo.new; $foo.bar;
ipsum

class foo { has $!baz; method bar { my $!baz = 'lorem'; say $!baz;
}; }; my $foo = foo.new; $foo.bar;
Use of uninitialized value

--
Carlin

These now all fail similarly;

08​:53 < [Coke]> rakudo​: class foo { method bar { my $!baz = 'lorem'; say $!baz;
  }; };
08​:54 <+p6eval> rakudo 9719f7​: OUTPUT«===SORRY!===␤Cannot use ! twigil on my
  variable at line 1, near " = 'lorem'"␤»

08​:54 < [Coke]> rakudo​: class foo { has $!baz = 'ipsum'; method bar { my $!baz
  = 'lorem';say $!baz; }; }; my $foo = foo.new; $foo.bar;
08​:54 <+p6eval> rakudo 9719f7​: OUTPUT«===SORRY!===␤Cannot use ! twigil on my
  variable at line 1, near " = 'lorem'"␤»

08​:53 < [Coke]> rakudo​: class foo { has $!baz; method bar { my $!baz = 'lorem';
  say $!baz; }; }; my $foo = foo.new; $foo.bar;
08​:53 <+p6eval> rakudo 9719f7​: OUTPUT«===SORRY!===␤Cannot use ! twigil on my
  variable at line 1, near " = 'lorem'"␤»

... closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 30, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 30, 2012

From @moritz

Tested in S32-exceptions/misc.t.

@p6rt
Copy link
Author

p6rt commented Jan 30, 2012

@moritz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant