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

error when installing module #80

Open
brandonm78 opened this issue Feb 23, 2022 · 2 comments
Open

error when installing module #80

brandonm78 opened this issue Feb 23, 2022 · 2 comments

Comments

@brandonm78
Copy link

Im trying to install this module on Ubuntu version 20 and getting the following error. Any help would be appreciated.

:~/ronin/raku$ zef install https://github.com/timo/json_fast.git
===> Testing: JSON::Fast:ver<0.17>:authcpan:TIMOTIMO
[JSON::Fast] Cannot resolve caller subst(Str:D: Str:D, :global); none of these signatures match:
[JSON::Fast] (Str:D: Str:D $original, Str:D $final, *%options)
[JSON::Fast] (Str:D: $matcher, $replacement, *%options)
[JSON::Fast] in block at t/13-scopes.t line 6
===> Testing [FAIL]: JSON::Fast:ver<0.17>:authcpan:TIMOTIMO
Aborting due to test failure: JSON::Fast:ver<0.17>:authcpan:TIMOTIMO (use --force-test to override)

@coke
Copy link
Contributor

coke commented Apr 26, 2023

What version of raku do you have? Current version is now 2023.04

@timo
Copy link
Owner

timo commented Apr 30, 2023

commit dfb563af782fb93935e1dc74a8dbd512d25b626f
Author: Elizabeth Mattijsen <[email protected]>
Date:   Fri Nov 8 15:48:54 2019 +0100

    Allow for 1 positional arg .subst
    
    Not specifying a replacement means the empty string, aka, removing
    the matched string(s).  Wonder why we didn't think about that before.

diff --git a/src/core.c/Cool.pm6 b/src/core.c/Cool.pm6
index 098321054..30409abe1 100644
--- a/src/core.c/Cool.pm6
+++ b/src/core.c/Cool.pm6
@@ -322,7 +322,7 @@ my class Cool { # declared in BOOTSTRAP
         $/ := nqp::getlexcaller('$/');
         {*}
     }
-    multi method subst(Cool:D: $original, $replacement, *%options) {
+    multi method subst(Cool:D: $original, $replacement = "", *%options) {
         $/ := nqp::getlexcaller('$/');
         self.Stringy.subst($original, $replacement, |%options);
     }

this commit added the ability to use subst without a second argument to get "" as default. This is only used in test code, so I'm just going to make it backwards compatible I think.

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

3 participants