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

$.foo attribute generates non-multi methods #1272

Closed
p6rt opened this issue Sep 4, 2009 · 6 comments
Closed

$.foo attribute generates non-multi methods #1272

p6rt opened this issue Sep 4, 2009 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 4, 2009

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

Searchable as RT68996$

@p6rt
Copy link
Author

p6rt commented Sep 4, 2009

From jswitzer@gmail.com

(12​:56​:30) s1n​: rakudo​: class A { has $.foo = 'bar'; multi method foo(Str
$test) { say $test }}; my $a = A.new; $a.foo("oh hai")
(12​:56​:39) p6eval​: rakudo b51d94​: OUTPUT«push_pmc() not implemented in class
'Sub'␤»
(12​:56​:49) s1n​: rakudobug?
(12​:57​:54) synth left the room (quit​: "Leaving").
(12​:58​:33) moritz_​: known bug
(12​:58​:42) moritz_​: Ovid++ reported it a few months back
(12​:58​:51) moritz_​: hm
(12​:58​:54) moritz_​: oh wait
(12​:59​:15) moritz_​: I think in Ovid's case it was not a mulit method, just a
single one (iirc)
(12​:59​:52) moritz_​: s1n​: I'm not sure. So in case of doubt, please report
(13​:00​:01) moritz_​: has $.foo installs a method foo
(13​:00​:06) moritz_​: but IMHO it should be a multi
(13​:00​:55) ***s1n submits

As far as I can tell, that should generate multi methods so I can provide
additional accessors. I'm not sure what the spec says on the matter though,
so this may be invalid.

-Jason "s1n" Switzer

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

NOM​: works, taking to add tests

bbkr​:nom bbkr$ ./perl6 -e 'class A { has $.foo = "bar"; multi method
foo(Str $test) { say $test }}; my $a = A.new; $a.foo("oh hai");'
oh hai

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

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

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

Test added in S12-methods/multi.t.

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

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

@p6rt p6rt closed this as completed Sep 11, 2011
@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

1​:34
jnthn
bbkr​: That test doesn't pass for the reason you think it does. Also, I'm
not sure I agree with the ticket.

jnthn
bbkr​: It passes because if there's already a method in the class with
the appropriate name, the automatic accessor method is not generated.

1​:37
bbkr
jnthn​: so if skipping accessor when method is present is desired
behavior maybe I should add another line with dies_ok { $a.foo } to
prove it?

1​:40
jnthn
bbkr​: Well, but the answer isn't that no multi method is generated. It's
more that no method at all is generated.
bbkr​: e.g. you could drop "multi" and get the same effect

@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