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

S12 Tiebreaker algorithm A should dispatch to the first candidate that matches in Rakudo #1226

Closed
p6rt opened this issue Aug 14, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 14, 2009

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

Searchable as RT68528$

@p6rt
Copy link
Author

p6rt commented Aug 14, 2009

From @masak

<jnthn> rakudo​: multi foo(​:$a!, *%_) {}; multi foo(​:$b, *%_) {}; foo(​:a, :b)
<p6eval> rakudo 0d4fe0​: OUTPUT«Ambiguous dispatch to multi 'foo'.
Ambiguous candidates had signatures​:␤​:(Any :$a, Object *%_)␤​:(Any
:$b?, Object *%_)␤in Main (/tmp/1JICUeh8sD​:2)␤»
[...]
<jnthn> So for tiebreaker
<jnthn> A the candidates are simply called in the order they were declared,
<jnthn> and the first one that successfully binds (and completes without
<jnthn> calling nextsame or nextwith) is considered the winner, and all the
<jnthn> other tied candidates are ignored.
[...]
<jnthn> If I understand S12 correctly, then by the spec the tie you
got earlier is a bug.
<jnthn> And the first candidate that appeared textually in your
program shoulda won.

@p6rt
Copy link
Author

p6rt commented Oct 16, 2011

From @coke

2+ years, still ambiguous​:

10​:35 < [Coke]> rakudo​: multi foo(​:$a!, *%_) {}; multi foo(​:$b, *%_) {};
  foo(​:a, :b)
10​:35 <+p6eval> rakudo 25af2d​: OUTPUT«Ambiguous dispatch to multi 'foo'.
  Ambiguous candidates had signatures​:␤​:(Any $a, Associative
  %_)␤​:(Any $b, Associative %_)␤␤ in block <anon> at
  /tmp/6V7yVjBiLw​:1␤ in <anon> at /tmp/6V7yVjBiLw​:1␤»

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 16, 2011

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 29, 2013

From @coke

On Sun Oct 16 07​:36​:18 2011, coke wrote​:

2+ years, still ambiguous​:

10​:35 < [Coke]> rakudo​: multi foo(​:$a!, *%_) {}; multi foo(​:$b, *%_) {};
foo(​:a, :b)
10​:35 <+p6eval> rakudo 25af2d​: OUTPUT«Ambiguous dispatch to multi 'foo'.
Ambiguous candidates had signatures​:␤​:(Any $a, Associative
%_)␤​:(Any $b, Associative %_)␤␤ in block <anon> at
/tmp/6V7yVjBiLw​:1␤ in <anon> at /tmp/6V7yVjBiLw​:1␤»

This is no longer ambiguous - test added in S06-multi/syntax.t, closing ticket.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Mar 29, 2013

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

@p6rt p6rt closed this as completed Mar 29, 2013
@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