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

nextsame in method dispatch doesn't pass on self #1102

Closed
p6rt opened this issue Jun 25, 2009 · 7 comments
Closed

nextsame in method dispatch doesn't pass on self #1102

p6rt opened this issue Jun 25, 2009 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 25, 2009

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

Searchable as RT66978$

@p6rt
Copy link
Author

p6rt commented Jun 25, 2009

From johan.viklund@gmail.com

-- code --
class A {
  method a(*@​A) {
  say "A self={self.perl} arg={@​A.perl}"
  }
}

class B is A {
  method a(*@​A) {
  nextwith("FIRST ARG", "SECOND ARG")}
}

B.new.a()

-- output --

A self="FIRST ARG" arg=["SECOND ARG"]

-- what I expected --

A self=B.new() arg=["FIRST ARG", "SECOND ARG"]

-- comment --

If you are supposed to supply self as the first argument to nextwith
for this to work, I think I should get a "Method not found" error in
this case.

--
Johan Viklund

@p6rt
Copy link
Author

p6rt commented Jul 8, 2009

From @jnthn

On Thu Jun 25 15​:43​:59 2009, viklund wrote​:

-- code --
class A {
method a(*@​A) {
say "A self={self.perl} arg={@​A.perl}"
}
}

class B is A {
method a(*@​A) {
nextwith("FIRST ARG", "SECOND ARG")}
}

B.new.a()

-- output --

A self="FIRST ARG" arg=["SECOND ARG"]

-- what I expected --

A self=B.new() arg=["FIRST ARG", "SECOND ARG"]

-- comment --

If you are supposed to supply self as the first argument to nextwith
for this to work, I think I should get a "Method not found" error in
this case.

Yes, it was supposed to give the output you expected, but failed to due
to a bug. Fixed in git 48c1791 and added an example like this as a
regression test too (plus similar one for callwith).

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Jul 8, 2009

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

@p6rt
Copy link
Author

p6rt commented Jul 8, 2009

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

@p6rt p6rt closed this as completed Jul 8, 2009
@p6rt
Copy link
Author

p6rt commented Jul 8, 2009

From @moritz

jnthn@​jnthn.net via RT wrote​:

On Thu Jun 25 15​:43​:59 2009, viklund wrote​:

-- code --
class A {
method a(*@​A) {
say "A self={self.perl} arg={@​A.perl}"
}
}

class B is A {
method a(*@​A) {
nextwith("FIRST ARG", "SECOND ARG")}
}

B.new.a()

-- output --

A self="FIRST ARG" arg=["SECOND ARG"]

-- what I expected --

A self=B.new() arg=["FIRST ARG", "SECOND ARG"]

-- comment --

If you are supposed to supply self as the first argument to nextwith
for this to work, I think I should get a "Method not found" error in
this case.

Yes, it was supposed to give the output you expected, but failed to due
to a bug. Fixed in git 48c1791 and added an example like this as a
regression test too (plus similar one for callwith).

Did you actually commit it? I noticed no such commit...

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jul 8, 2009

From @moritz

ok, jnthn++ now committed the tests too.

@p6rt
Copy link
Author

p6rt commented Jul 10, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in at least one of these files​: b/t/spec/S12-methods/defer-call.t, b/t/spec/S12-methods/defer-next.t

@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