Parser rejects our self-reference in its initializer under strict vars
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by tracing how our declarations are handled and how strict 'vars' resolves initializer references in both the JVM and interpreter backends. Reproduce with our $V = $V = 119; under strict vars and compare with system Perl. Done when both backends compile the case and leave $V equal to 119.
索引モデルが issue の本文から書いたものです。
説明
Summary
The parser rejects a valid our declaration when its initializer reads the variable being declared under strict 'vars'. This breaks CPAN distribution Text-Template 1.61: t/delimiters.t stops at compile time with Global symbol "$V" requires explicit package name, before running its assertions. System Perl 5.42.2 accepts the source, and the complete upstream distribution suite passes there (22 files, 184 tests). Both PerlOnJava backends reject it.
Root cause
The declaration's initializer is resolved before the our variable is entered into the current lexical symbol table. Perl makes the our alias visible in the declaration's initializer, so the self-assignment in this valid initializer must resolve to the package variable. The package glob being materialized during declaration handling is not sufficient: strict-variable resolution uses the lexical symbol table and reports the RHS $V as undeclared.
This was independently reproduced with the one-line case in the comment. It fails under both the JVM and interpreter backends and succeeds under system Perl. The failure is included in archived CPAN run 20261104-151051-20617.
Expected behavior
our $V = $V = 119; compiles under use strict and leaves $V equal to 119, as it does in system Perl.
- 主要言語
- Perl
- スター
- 65
- フォーク
- 8
- 平均マージ
- 5時間 45分
- マージ済み PR(30日)
- 184
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
area:runtime documentation enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#1579 ·
メンテナーはふだん 1 日以内に返信
-
area:backend bug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
fglock/PerlOnJava#1981 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:runtime bug
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
fglock/PerlOnJava#1980 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fglock/PerlOnJava#1962 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
fglock/PerlOnJava#1961 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
wave-followup
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
benchmarks/README: 'perl BNG2.pl model.bngl' runs the whole protocol, not just generate_networkオープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信