Coder Social home page Coder Social logo

Comments (7)

softmoth avatar softmoth commented on August 28, 2024 1

It's not affecting anyone as far as I know, and I suspect it's a generic gotcha with Raku rather than an actual bug. But I've left this bug open as a warning and reminder to any future maintainer that something brittle and poorly understood may be going on. And as an invitation for anyone who knows better to proffer an improvement.

from raku-template-mustache.

Xliff avatar Xliff commented on August 28, 2024

Odd. I get something different:

An operation first awaited:
  in block  at t/11-iterable.t line 71
  in block <unit> at t/11-iterable.t line 38

Died with the exception:
    A worker in a parallel iteration (hyper or race) initiated here:
      in block  at /home/cbwood/.zef/store/Template-Mustache-1.2.3.tar.gz/Template-Mustache-1.2.3/lib/Template/Mustache.rakumod (Template::Mustache) line 577
      in block  at /home/cbwood/.zef/store/Template-Mustache-1.2.3.tar.gz/Template-Mustache-1.2.3/lib/Template/Mustache.rakumod (Template::Mustache) line 566
      in sub format at /home/cbwood/.zef/store/Template-Mustache-1.2.3.tar.gz/Template-Mustache-1.2.3/lib/Template/Mustache.rakumod (Template::Mustache) line 537
      in sub format at /home/cbwood/.zef/store/Template-Mustache-1.2.3.tar.gz/Template-Mustache-1.2.3/lib/Template/Mustache.rakumod (Template::Mustache) line 397
      in sub format at /home/cbwood/.zef/store/Template-Mustache-1.2.3.tar.gz/Template-Mustache-1.2.3/lib/Template/Mustache.rakumod (Template::Mustache) line 397
      in method render at /home/cbwood/.zef/store/Template-Mustache-1.2.3.tar.gz/Template-Mustache-1.2.3/lib/Template/Mustache.rakumod (Template::Mustache) line 295
      in block  at t/11-iterable.t line 57

    Died at:
        Cannot invoke object with invocation handler in this context

This is from Raku v2021.02.1-64-gbf67b1f71

from raku-template-mustache.

softmoth avatar softmoth commented on August 28, 2024

Yes, Xliff, I get the same error as you. I'd accidentally switched to an older Raku and forgot to switch back before reporting.

from raku-template-mustache.

softmoth avatar softmoth commented on August 28, 2024

This bug is triggered by calling .Str or .gist on the HyperSeq prior to calling .map. In Template::Mustache, the call to .Str is in sub resolve, and removing line 426 causes the test case to succeed.

This is a golfed down test case:

my $hyp = (gather { take $(:line("line 1")) }).hyper;

# XXX THIS TRIGGERS THE SUBSEQUENT CRASH
$hyp.Str;

my $result = $hyp.map({ .raku }).join;

put "RESULT «{$result}»";

What remains to be resolved is whether this is a bug in Template::Mustache or in Rakudo.

from raku-template-mustache.

softmoth avatar softmoth commented on August 28, 2024

Workaround pushed as b1fbd76. I don't know what the right solution really is, so leaving this open.

from raku-template-mustache.

Xliff avatar Xliff commented on August 28, 2024

Nice job, @softmoth!

from raku-template-mustache.

2colours avatar 2colours commented on August 28, 2024

What's the current state of the issue?

from raku-template-mustache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.