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

A definite nothing should be narrower than two possible somethings in Rakudo #1744

Closed
p6rt opened this issue May 4, 2010 · 4 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented May 4, 2010

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

Searchable as RT74900$

@p6rt
Copy link
Author

p6rt commented May 4, 2010

From @masak

<masak> the lack of an argument counts as narrower than a slurpy.
<masak> but what about a single optional?
<masak> rakudo​: multi foo() { say "OH HAI" }; multi foo(Int $a?) {};
multi foo(Str $a?) {}; foo
<p6eval> rakudo 1eef08​: OUTPUT«Ambiguous dispatch to multi 'foo'.
Ambiguous candidates had signatures​:␤​:()␤​:(Int $a?)␤​:(Str $a?) [...]
<masak> any reason one shouldn't count the lack of an argument as
narrower there too?
<masak> it would be a nice way to resolve the ensuing ambiguity
between :(Int $a?) and :(Str $a?)
<spinclad> masak​: a definite nothing is narrower than a possible Int
or Str, i agree
* masak submits rakudobug
<masak> might need a bit of spec too, maybe.

@p6rt
Copy link
Author

p6rt commented Nov 23, 2015

From @jnthn

On Tue May 04 13​:49​:19 2010, masak wrote​:

<masak> the lack of an argument counts as narrower than a slurpy.
<masak> but what about a single optional?
<masak> rakudo​: multi foo() { say "OH HAI" }; multi foo(Int $a?) {};
multi foo(Str $a?) {}; foo
<p6eval> rakudo 1eef08​: OUTPUT«Ambiguous dispatch to multi 'foo'.
Ambiguous candidates had signatures​:␤​:()␤​:(Int $a?)␤​:(Str $a?) [...]
<masak> any reason one shouldn't count the lack of an argument as
narrower there too?
<masak> it would be a nice way to resolve the ensuing ambiguity
between :(Int $a?) and :(Str $a?)
<spinclad> masak​: a definite nothing is narrower than a possible Int
or Str, i agree
* masak submits rakudobug
<masak> might need a bit of spec too, maybe.

Implemented it, though it fell out rather more naturally as a tie-break rather than by further complicating the narrowness analysis. Tests in S06-multi/syntax.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Nov 23, 2015

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

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

p6rt commented Nov 23, 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