Skip to content

Parser rejects valid block argument syntax in Resource::Silo #1491

Description

@fglock

Summary

PerlOnJava rejects valid Perl syntax used by Resource::Silo 0.1703. The
failure occurs while compiling the module, before its tests can run.

Reproduction

This standard-Perl expression is accepted by Perl 5:

my $shortcut_sub = set_prototype {
    $instance //= $target->new;
} '';

PerlOnJava reports a syntax error at the closing expression. The smallest
reproducer is:

use Scalar::Util qw(set_prototype);
my $x = set_prototype { 1 } q{};

Evidence

  • Distribution: Resource-Silo 0.1703
  • CPAN random tester run: 20260922-180448-60378
  • Failing test: t/001-load.t, during use Resource::Silo
  • System Perl: PASS, 39 test files and 148 tests
  • PerlOnJava JVM backend: FAIL
  • PerlOnJava interpreter backend: FAIL
  • The minimal reproducer passes on system Perl and fails on both PerlOnJava
    backends.
  • The distribution is pure Perl and does not require XS or native code.

Expected behavior

PerlOnJava should parse and execute a function call whose first argument is an
anonymous block followed by a second expression, matching standard Perl's
handling of set_prototype { ... } ''.

Acceptance criteria

  • Add focused project-owned regression coverage for this syntax.
  • The regression passes on both JVM and interpreter backends.
  • Resource-Silo 0.1703 passes its complete upstream test suite.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:parserParsing compilation AST and eval behaviorbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions