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

Callable roles fail to compile with non-meta method calls on self #3720

Open
p6rt opened this issue Mar 6, 2015 · 3 comments
Open

Callable roles fail to compile with non-meta method calls on self #3720

p6rt opened this issue Mar 6, 2015 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 6, 2015

Migrated from rt.perl.org#124006 (status was 'open')

Searchable as RT124006$

@p6rt
Copy link
Author

p6rt commented Mar 6, 2015

From @raydiak

See http://irclog.perlgeek.de/perl6/2015-03-06#i_10237431 and the next few examples.

perl6 -e 'role R does Callable { method foo { self.say } }'
===SORRY!===
Internal error​: failed to remove block

Removing the Callable role, or inheriting with 'is' instead of composing, makes the error go away. Calling metamethods (.WHAT tested) also works.

Even removing the method surrounding the call gives the same error, instead of 'no self available'.

@p6rt
Copy link
Author

p6rt commented Sep 26, 2017

From @skids

On Fri, 06 Mar 2015 14​:10​:06 -0800, raydiak@​cyberuniverses.com wrote​:

See http://irclog.perlgeek.de/perl6/2015-03-06#i_10237431 and the next
few examples.

perl6 -e 'role R does Callable { method foo { self.say } }'
===SORRY!===
Internal error​: failed to remove block

Removing the Callable role, or inheriting with 'is' instead of
composing, makes the error go away. Calling metamethods (.WHAT tested)
also works.

Even removing the method surrounding the call gives the same error,
instead of 'no self available'.

Current behavior suggests this has been fixed​:

$ perl6 -e 'role R does Callable { method foo { self.say } }'
$ perl6 -e 'role R does Callable { method foo { self.say } }; R.foo'
(R)
$ perl6 -e 'role R does Callable { self.say }; R.foo'
===SORRY!=== Error while compiling -e
'self' used where no object is available
at -e​:1
------> role R does Callable {⏏ self.say }; R.foo
  expecting any of​:
  term

@p6rt
Copy link
Author

p6rt commented Sep 26, 2017

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

@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