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

Fix wrong multi dispatch / Crash in multiple same-named routines #6

Merged
merged 3 commits into from
Oct 21, 2017

Conversation

zoffixznet
Copy link
Contributor

@zoffixznet zoffixznet commented Oct 21, 2017

See individual commit messages for details.

Currently, all the multi calls go into the first candidate, which
results in a Bool being unpacked into :returns and :&test. On
latest Rakudos, Bool.Capture was made to throw precicely to catch
this sort of bugs.

Fix by adding proper type contraints so dispatch happens to right
candidates.
Since subs are lexical, it's possible to add more than one
sub with the same name. This causes a crash because hash is
type-constrainted to Routine, but Hash.push with existing key
creates an Array there.

Fix by removing that type constraint and modifying run-tests routine
to be able to handle multi-named subs in a key.
@FCO FCO merged commit da43624 into FCO:master Oct 21, 2017
@FCO
Copy link
Owner

FCO commented Oct 21, 2017

Thank you very much!

@zoffixznet zoffixznet deleted the fix-unpack branch October 21, 2017 19:57
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

Successfully merging this pull request may close these issues.

2 participants