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 sub of Int doesn't smartmatch Callable[Int] #3355

Closed
p6rt opened this issue Mar 12, 2014 · 4 comments
Closed

A sub of Int doesn't smartmatch Callable[Int] #3355

p6rt opened this issue Mar 12, 2014 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 12, 2014

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

Searchable as RT121426$

@p6rt
Copy link
Author

p6rt commented Mar 12, 2014

From @masak

<timotimo> masak​: there's a rakudobug for you to report in #moarvm :)
<masak> r​: sub z of Int { }; say &z ~~ Callable
<camelia> rakudo-parrot 1aeb7c, rakudo-jvm 1aeb7c, rakudo-moar 1aeb7c​:
OUTPUT«True␤»
<masak> r​: sub z of Int { }; say &z ~~ Callable[Int]
<camelia> rakudo-parrot 1aeb7c, rakudo-jvm 1aeb7c, rakudo-moar 1aeb7c​:
OUTPUT«False␤»
* masak submits rakudobug
<masak> r​: multi x(Int &y) { say 1 }; multi x(Str &y) { say 2 }; sub z
of Int { }; x &z
<camelia> rakudo-moar 1aeb7c​: OUTPUT«Cannot call 'x'; none of these
signatures match​:␤​:(Int &y)␤​:(Str &y)␤ in sub x [...]»
<camelia> ..rakudo-parrot 1aeb7c​: OUTPUT«Cannot call 'x'; none of
these signatures match​:␤​:(Int &y)␤​:(Str &y)␤ in any [...]»
<camelia> ..rakudo-jvm 1aeb7c​: OUTPUT«Cannot call 'x'; none of these
signatures match​:␤​:(Int &y)␤​:(Str &y)␤ in any [...]»

The signature error is likely caused by &z not smartmatching
Callable[Int]. Fix that, and the last eval should start working, too.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2015

From @jnthn

On Wed Mar 12 05​:29​:11 2014, masak wrote​:

<timotimo> masak​: there's a rakudobug for you to report in #moarvm :)
<masak> r​: sub z of Int { }; say &z ~~ Callable
<camelia> rakudo-parrot 1aeb7c, rakudo-jvm 1aeb7c, rakudo-moar 1aeb7c​:
OUTPUT«True␤»
<masak> r​: sub z of Int { }; say &z ~~ Callable[Int]
<camelia> rakudo-parrot 1aeb7c, rakudo-jvm 1aeb7c, rakudo-moar 1aeb7c​:
OUTPUT«False␤»
* masak submits rakudobug
<masak> r​: multi x(Int &y) { say 1 }; multi x(Str &y) { say 2 }; sub z
of Int { }; x &z
<camelia> rakudo-moar 1aeb7c​: OUTPUT«Cannot call 'x'; none of these
signatures match​:␤​:(Int &y)␤​:(Str &y)␤ in sub x [...]»
<camelia> ..rakudo-parrot 1aeb7c​: OUTPUT«Cannot call 'x'; none of
these signatures match​:␤​:(Int &y)␤​:(Str &y)␤ in any [...]»
<camelia> ..rakudo-jvm 1aeb7c​: OUTPUT«Cannot call 'x'; none of these
signatures match​:␤​:(Int &y)␤​:(Str &y)␤ in any [...]»

The signature error is likely caused by &z not smartmatching
Callable[Int]. Fix that, and the last eval should start working, too.

Fixed, and added tests in S06-signature/types.t and S06-multi/type-based.t.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2015

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

@p6rt p6rt closed this as completed Oct 6, 2015
@p6rt
Copy link
Author

p6rt commented Oct 6, 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