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

Odd "'self' not found" error when mixing a role (containing a 'my $!foo' declaration) into a class in Rakudo #2064

Closed
p6rt opened this issue Aug 12, 2010 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Aug 12, 2010

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

Searchable as RT77184$

@p6rt
Copy link
Author

p6rt commented Aug 12, 2010

From @masak

<tylercurtis> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C does A does B; say 'alive';
<p6eval> rakudo 811c1c​: OUTPUT«===SORRY!===â�¤Lexical 'self' not foundâ�¤Â»
<masak> rakudo​: role A { my $!foo }; class C does A {}
<p6eval> rakudo 811c1c​: OUTPUT«===SORRY!===â�¤Lexical 'self' not foundâ�¤Â»
<masak> tylercurtis​: known bug?
<tylercurtis> masak​: Don't know.
* masak submits rakudobug
<masak> rakudo​: role A { my $!foo }; say "alive"
<p6eval> rakudo 811c1c​: OUTPUT«aliveâ�¤Â»
<masak> rakudo​: role A { my $!foo }; say A.new; say "alive"
<p6eval> rakudo 811c1c​: OUTPUT«Lexical 'self' not foundâ�¤[...]
<masak> interesting.
<masak> observe how those are actually two types of errors. is the
first parse-time and the second run-time, or something?

@p6rt
Copy link
Author

p6rt commented Oct 9, 2011

From @coke

On Thu Aug 12 14​:35​:18 2010, masak wrote​:

<tylercurtis> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C does A does B; say 'alive';

12​:08 < [Coke]> rakudo​: role A { my $!foo; }; role B { my $!foo; }; class C
  does A does B; say 'alive';
12​:08 <+p6eval> rakudo f6eb61​: OUTPUT«===SORRY!===â�¤Too late for semicolon form
  of $*PKGDECL definition at line 1, near "say 'alive"â�¤Â»

Can you rephrase the code to either still show the issue or show that it's fixed?

<p6eval> rakudo 811c1c​: OUTPUT«===SORRY!===â�¤Lexical 'self' not foundâ�¤Â»
<masak> rakudo​: role A { my $!foo }; class C does A {}
<p6eval> rakudo 811c1c​: OUTPUT«===SORRY!===â�¤Lexical 'self' not foundâ�¤Â»
<masak> tylercurtis​: known bug?
<tylercurtis> masak​: Don't know.
* masak submits rakudobug
<masak> rakudo​: role A { my $!foo }; say "alive"
<p6eval> rakudo 811c1c​: OUTPUT«aliveâ�¤Â»
<masak> rakudo​: role A { my $!foo }; say A.new; say "alive"
<p6eval> rakudo 811c1c​: OUTPUT«Lexical 'self' not foundâ�¤[...]
<masak> interesting.
<masak> observe how those are actually two types of errors. is the
first parse-time and the second run-time, or something?

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 9, 2011

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

@p6rt
Copy link
Author

p6rt commented Oct 10, 2011

From @masak

On Sun Oct 09 09​:10​:12 2011, coke wrote​:

On Thu Aug 12 14​:35​:18 2010, masak wrote​:

<tylercurtis> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C does A does B; say 'alive';

12​:08 < [Coke]> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C
does A does B; say 'alive';
12​:08 <+p6eval> rakudo f6eb61​: OUTPUT«===SORRY!===â�¤Too late for
semicolon form
of $*PKGDECL definition at line 1, near "say 'alive"�»

Can you rephrase the code to either still show the issue or show that
it's fixed?

Certainly.

<masak> rakudo​: role A { my $!foo; }; role B { my $!foo; }; class C does
A does B {}; say 'alive'
<p6eval> rakudo f6eb61​: OUTPUT«aliveâ�¤Â»

So, it's fixed now. Marking as needstest.

@p6rt
Copy link
Author

p6rt commented Nov 12, 2011

From @tadzik

70c5eb7f78 brings tests for this one. Closable.

@p6rt
Copy link
Author

p6rt commented Nov 12, 2011

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

@p6rt p6rt closed this as completed Nov 12, 2011
@p6rt
Copy link
Author

p6rt commented May 15, 2015

From @usev6

On Mon Oct 10 02​:13​:12 2011, masak wrote​:

On Sun Oct 09 09​:10​:12 2011, coke wrote​:

On Thu Aug 12 14​:35​:18 2010, masak wrote​:

<tylercurtis> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C does A does B; say 'alive';

12​:08 < [Coke]> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C
does A does B; say 'alive';
12​:08 <+p6eval> rakudo f6eb61​: OUTPUT«===SORRY!===â�¤Too late for
semicolon form
of $*PKGDECL definition at line 1, near "say 'alive"�»

Can you rephrase the code to either still show the issue or show that
it's fixed?

Certainly.

<masak> rakudo​: role A { my $!foo; }; role B { my $!foo; }; class C does
A does B {}; say 'alive'
<p6eval> rakudo f6eb61​: OUTPUT«aliveâ�¤Â»

So, it's fixed now. Marking as needstest.

For the records​: Nowadays this fails with X​::Syntax​::Variable​::Twigil​:

$ perl6-m -e 'role A { my $!foo; }; role B { my $!foo; }; class C does A does B {}; say "alive"'
===SORRY!=== Error while compiling -e
Cannot use ! twigil on my variable
at -e​:1
------> role A { my $!foo�; }; role B { my $!foo; }; class C does
  expecting any of​:
  constraint

I changed the skipped test in S14-roles/mixin.t to 'throws_like'​: Raku/roast@5cb6bc1eae

1 similar comment
@p6rt
Copy link
Author

p6rt commented May 15, 2015

From @usev6

On Mon Oct 10 02​:13​:12 2011, masak wrote​:

On Sun Oct 09 09​:10​:12 2011, coke wrote​:

On Thu Aug 12 14​:35​:18 2010, masak wrote​:

<tylercurtis> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C does A does B; say 'alive';

12​:08 < [Coke]> rakudo​: role A { my $!foo; }; role B { my $!foo; };
class C
does A does B; say 'alive';
12​:08 <+p6eval> rakudo f6eb61​: OUTPUT«===SORRY!===â�¤Too late for
semicolon form
of $*PKGDECL definition at line 1, near "say 'alive"�»

Can you rephrase the code to either still show the issue or show that
it's fixed?

Certainly.

<masak> rakudo​: role A { my $!foo; }; role B { my $!foo; }; class C does
A does B {}; say 'alive'
<p6eval> rakudo f6eb61​: OUTPUT«aliveâ�¤Â»

So, it's fixed now. Marking as needstest.

For the records​: Nowadays this fails with X​::Syntax​::Variable​::Twigil​:

$ perl6-m -e 'role A { my $!foo; }; role B { my $!foo; }; class C does A does B {}; say "alive"'
===SORRY!=== Error while compiling -e
Cannot use ! twigil on my variable
at -e​:1
------> role A { my $!foo�; }; role B { my $!foo; }; class C does
  expecting any of​:
  constraint

I changed the skipped test in S14-roles/mixin.t to 'throws_like'​: Raku/roast@5cb6bc1eae

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