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

Behaviour of variable phasers LTA in class definition: #4337

Closed
p6rt opened this issue Jun 22, 2015 · 6 comments
Closed

Behaviour of variable phasers LTA in class definition: #4337

p6rt opened this issue Jun 22, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jun 22, 2015

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

Searchable as RT125455$

@p6rt
Copy link
Author

p6rt commented Jun 22, 2015

From @jonathanstowe

Hi,

  class A { my $boo will leave { say "leaving boo" }; }

gives rise to​:

  Method 'add_phaser' not found for invocant of class 'A'

I appreciate that this may not be implemented yet but it would probably be nicer if it threw a NYI exception rather than just failing like that.

Or, at option, moving the code in Block into a trait which can be applied to classes as well :-)

@p6rt
Copy link
Author

p6rt commented Jun 22, 2015

From @jonathanstowe

On

This is perl6 version 2015.06-9-gd474242 built on MoarVM version 2015.06-15-g7131eab

for reference.

@p6rt
Copy link
Author

p6rt commented Jun 22, 2015

From @lizmat

On 22 Jun 2015, at 11​:41, Jonathan Stowe (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Jonathan Stowe
# Please include the string​: [perl #​125455]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=125455 >

Hi,

class A { my $boo will leave { say "leaving boo" }; }

gives rise to​:

Method 'add_phaser' not found for invocant of class 'A'

I appreciate that this may not be implemented yet but it would probably be nicer if it threw a NYI exception rather than just failing like that.

Or, at option, moving the code in Block into a trait which can be applied to classes as well :-)

I’m not sure what “will leave” on a class lexical would mean?

I agree the error is LTA, but perhaps it shouldn’t be allowed at all?

Liz

@p6rt
Copy link
Author

p6rt commented Jun 22, 2015

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

@p6rt
Copy link
Author

p6rt commented Jun 23, 2015

From @jnthn

On Mon Jun 22 02​:41​:21 2015, jns+bc@​gellyfish.co.uk wrote​:

Hi,

class A { my $boo will leave { say "leaving boo" }; }

gives rise to​:

Method 'add_phaser' not found for invocant of class 'A'

I appreciate that this may not be implemented yet but it would
probably be nicer if it threw a NYI exception rather than just failing
like that.

Or, at option, moving the code in Block into a trait which can be
applied to classes as well :-)

It was in theory implemented; in practice, an oversight meant it couldn't work. Fixed, and added test coverage in S04-declarations/will.t.

@p6rt p6rt closed this as completed Jun 23, 2015
@p6rt
Copy link
Author

p6rt commented Jun 23, 2015

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

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

No branches or pull requests

1 participant