Export fieldhash from Hash::Util

已關閉
#1,909 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
perl
領域
backend

研究方向

Start with PerlOnJava’s bundled Hash::Util and its Hash::Util::FieldHash implementation; the issue identifies these APIs as the affected code. Run the reproducer on the JVM and interpreter backends, then check the project’s fieldhash tests and the Hash-ExtendedKeys 1.01 suite. Done means export succeeds, scalar keys work alongside reference keys, and the requested suites pass on both backends and system Perl.

由索引模型根據 Issue 內容生成。

描述

area:runtime bug

Summary

PerlOnJava's bundled Hash::Util omits the core fieldhash export, so CPAN module Hash::ExtendedKeys cannot load. After restoring the export, its tests also expose that the bundled fieldhash tie rejects ordinary scalar keys; core Perl treats those as regular hash entries.

Reproducer

use Hash::Util qw(fieldhash);
fieldhash my %fields;
$fields{plain_key} = 'value';

Expected: the import succeeds; ordinary scalar keys behave like normal hash entries, and reference keys retain identity-based fieldhash behavior.

PerlOnJava JVM and interpreter: before the export fix, compilation stops with "fieldhash" is not exported by the Hash::Util module. With the export restored but before scalar-key support, Hash-ExtendedKeys tests fail with Hash::Util::FieldHash keys must be references.

CPAN evidence

  • Distribution: Hash-ExtendedKeys 1.01
  • CPAN random tester run: 20261027-085020-3852
  • Original failing test: t/00-load.t; import aborts before the suite proceeds
  • System Perl 5.42.2: complete unchanged upstream suite passes (7 files, 24 tests)
  • PerlOnJava Perl 5.044001: import failure reproduced on both JVM and interpreter backends; additional fieldhash behavior gap exposed on JVM

The failure was observed on macOS 26. The affected APIs are implemented by PerlOnJava's bundled modules. This is distinct from #1379, which fixed Hash::Util::FieldHash's :all export tag.

Acceptance

  • Export fieldhash from Hash::Util with behavior compatible with core Perl's Hash::Util::FieldHash.
  • Preserve ordinary scalar-key operations alongside reference-key fieldhash behavior.
  • Add project-owned coverage validated on system Perl and both PerlOnJava backends.
  • Confirm Hash-ExtendedKeys 1.01 loads and its unchanged suite passes.
主要語言
Perl
星號
65
分支
8
平均合併
5 小時 49 分鐘
30 天內合併 PR
177

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。