Emit constant-subroutine redefinition warning for equal cached values

Ouverte
#2,075 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
55/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
java, perl
Domaine
backend, testing

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
Perl
Étoiles
67
Forks
8
Merge moyen
5 h 12 min
PR mergées (30 j)
131

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de fglock/PerlOnJava

Toutes les issues de fglock/PerlOnJava

Issues similaires

Plus d'issues Perl

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.