Emit constant-subroutine redefinition warning for equal cached values

Aperta
#2,075 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, perl
Ambito
backend, testing

Direzione di ricerca

Start by reading RuntimeGlob and tracing isSameCachedConstant through the wrapper identity and cached scalar value checks. Add project owned regression coverage for the reported redefinition and same wrapper re-export cases, and first verify the expected warning behavior with standard Perl. Done means one warning on both PerlOnJava backends for replacement by a distinct wrapper with an equal cached value, and no spurious warning when re-exporting the same wrapper.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:runtime area:warnings bug

Summary

PerlOnJava misses Perl's constant-subroutine redefinition warning when a newly installed constant wrapper has the same cached return value as the previous wrapper.

Evidence

The Constant-Export-Lazy 0.17 test suite passed all 123 tests under system Perl 5.42.2. In CPAN random-tester run 20261116-130945-12232, PerlOnJava failed 2 of 15 assertions in t/private_name_munger.t on both the JVM and interpreter backends.

The test imports BLAH once, changes the private-name mapping, and imports BLAH again. It expects one warning matching Constant subroutine main::BLAH redefined; PerlOnJava reports no warning. The other assertions in the test pass.

Investigation clue

RuntimeGlob suppresses a redefinition warning when isSameCachedConstant considers the old and new constant wrappers equivalent by their cached scalar values. This case suggests that equal returned values do not make distinct constant subroutine definitions equivalent for Perl's redefinition-warning behavior. Please verify the wrapper identity and cached-value path while fixing it.

Acceptance criteria

  • The focused behavior emits one Constant subroutine main::BLAH redefined warning on both PerlOnJava backends.
  • Re-exporting the same constant wrapper without replacing its definition does not introduce a spurious warning.
  • Add project-owned regression coverage and validate its standard Perl behavior before using it to drive the fix.
Lingua principale
Perl
Stelle
67
Fork
8
Merge medio
5h 12m
PR unite (30g)
131

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.