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

Something is off with multi dispatch, natives and where clauses #3748

Open
p6rt opened this issue Mar 22, 2015 · 3 comments
Open

Something is off with multi dispatch, natives and where clauses #3748

p6rt opened this issue Mar 22, 2015 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Mar 22, 2015

Migrated from rt.perl.org#124142 (status was 'open')

Searchable as RT124142$

@p6rt
Copy link
Author

p6rt commented Mar 22, 2015

From @moritz

moritz@​pat​:~/p6/rakudo>cat ack.p6
proto a(int, int) {*};
multi a(int $ where 0, int \n) { n + 1 };
multi a(int \m, int $ where 0) { a m -1 , 1 };
multi a(int \m, int \n) {
  a m - 1, a m, n - 1
};
say a 3, 1

moritz@​pat​:~/p6/rakudo>./perl6-m ack.p6
Cannot call a(3, 1); none of these signatures match​:
  (int $ where { ... }, int \n)
  (int \m, int $ where { ... })
  (int \m, int \n)
  in block <unit> at ack.p6​:7

When I replace every instance of 'int' with 'Int' in the test program,
it works (no dispatch errors), and produces the output "13\n".

@p6rt
Copy link
Author

p6rt commented Dec 2, 2017

From @AlexDaniel

Still reproducible (2017.11, HEAD(5929887))

On 2015-03-22 05​:17​:48, moritz wrote​:

moritz@​pat​:~/p6/rakudo>cat ack.p6
proto a(int, int) {*};
multi a(int $ where 0, int \n) { n + 1 };
multi a(int \m, int $ where 0) { a m -1 , 1 };
multi a(int \m, int \n) {
a m - 1, a m, n - 1
};
say a 3, 1

moritz@​pat​:~/p6/rakudo>./perl6-m ack.p6
Cannot call a(3, 1); none of these signatures match​:
(int $ where { ... }, int \n)
(int \m, int $ where { ... })
(int \m, int \n)
in block <unit> at ack.p6​:7

When I replace every instance of 'int' with 'Int' in the test program,
it works (no dispatch errors), and produces the output "13\n".

@p6rt
Copy link
Author

p6rt commented Dec 2, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant