json_fast icon indicating copy to clipboard operation
json_fast copied to clipboard

error when installing module

Open brandonm78 opened this issue 3 years ago • 2 comments

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)

brandonm78 avatar Feb 23 '22 11:02 brandonm78

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

coke avatar Apr 26 '23 20:04 coke

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.

timo avatar Apr 30 '23 21:04 timo