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

Multi dispatch narrowness analysis doesn't ignore the part after ;; in the signature in Rakudo #4348

Closed
p6rt opened this issue Jun 25, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 25, 2015

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

Searchable as RT125483$

@p6rt
Copy link
Author

p6rt commented Jun 25, 2015

From @masak

<masak> disambiguating performs a narrowness analysis.
<masak> only things to the left of the ;; participate in it.
<jnthn> m​: multi a (;; Any $b) { say "one" }; multi a (;; Int $a) {
say "two" }; a(42)
<camelia> rakudo-moar 2bafa9​: OUTPUT«two␤»
<jnthn> I...think that one is a bug
<jnthn> We probably mis-handled initial ;;
<jnthn> That should be ambiguous
<masak> unless some other tiebreaking thing kicks in.
<jnthn> It shouldn't, I think we just don't handle initial ;; properly
<masak> m​: multi a ($b) { say "one" }; multi a ($a) { say "two" }; a(42)
<camelia> rakudo-moar 2bafa9​: OUTPUT«Ambiguous call to 'a'; these
signatures all match​:␤​:(Any $b)␤​:(Any $a)␤ [...]
<masak> that's the behavior I expect.
<jnthn> Right, same
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jun 29, 2015

From @jnthn

On Thu Jun 25 04​:09​:04 2015, masak wrote​:

<masak> disambiguating performs a narrowness analysis.
<masak> only things to the left of the ;; participate in it.
<jnthn> m​: multi a (;; Any $b) { say "one" }; multi a (;; Int $a) {
say "two" }; a(42)
<camelia> rakudo-moar 2bafa9​: OUTPUT«two␤»
<jnthn> I...think that one is a bug
<jnthn> We probably mis-handled initial ;;
<jnthn> That should be ambiguous
<masak> unless some other tiebreaking thing kicks in.
<jnthn> It shouldn't, I think we just don't handle initial ;; properly
<masak> m​: multi a ($b) { say "one" }; multi a ($a) { say "two" }; a(42)
<camelia> rakudo-moar 2bafa9​: OUTPUT«Ambiguous call to 'a'; these
signatures all match​:␤​:(Any $b)␤​:(Any $a)␤ [...]
<masak> that's the behavior I expect.
<jnthn> Right, same
* masak submits rakudobug

Already fixed by lizmat++; added test to S06-multi/type-based.t.

@p6rt
Copy link
Author

p6rt commented Jun 29, 2015

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

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

p6rt commented Jun 29, 2015

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

@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