[Runtime] Preserve prototypes assigned before Math::Complex sub definitions
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 57/100
Línea de trabajo
Start with the prototype handling for forward subs and later body definitions, then add the focused regression test requested in the issue. Verify that the assigned prototype is preserved without a mismatch warning, matching system Perl. Finally, run Template-Toolkit's t/math_rand.t on PerlOnJava and confirm it passes without unrelated warnings.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Loading core Math::Complex emits six false Prototype mismatch warnings, causing Template-Toolkit's t/math_rand.t warning assertion to fail.
Reproduction and evidence
On PerlOnJava commit 3893a1903799d49a4c0733bf231468bb6087cc13 (the PR base) and PR head 45c7c70903a79ab5ecbdbcc0c5a018613ef0b4a2, run:
timeout 1800 ./jcpan -t Template
Template-Toolkit 3.106 fails only t/math_rand.t (1 of 1 assertion). The assertion expects no warnings while calling rand/srand without arguments, but receives warnings such as Prototype mismatch: sub Math::Complex::abs (_) vs none at .../Math/Complex.pm line 694. The same failure and warning text reproduce on the pre-PR base, so this is independent of the MakeMaker changes in PR #1654.
The core src/main/perl/lib/Math/Complex.pm sets _ prototypes for abs, cos, exp, log, sin, and sqrt via Scalar::Util::set_prototype in its BEGIN block (around lines 99–106), then defines those subroutines without inline prototypes later in the file (for example sub abs {} around line 676). PerlOnJava treats the later body definitions as replacing the already-prototyped forward CV with a prototype-less CV and emits the (_) vs none mismatch warning. Perl preserves the prototype assigned to that CV; the definition should not clear it or warn.
Expected behavior
The six intentional Math::Complex overrides should retain their _ prototype without emitting mismatch warnings. Template's t/math_rand.t should see no unrelated warnings from loading Math::Complex.
Acceptance criteria
- Add a focused regression test for assigning a prototype to a forward sub and then defining its body without an inline prototype.
- Preserve the assigned prototype and avoid a false mismatch warning, matching system Perl.
- Confirm
Template::Toolkit'st/math_rand.tpasses on PerlOnJava.
- Lenguaje dominante
- Perl
- Estrellas
- 64
- Forks
- 7
- Merge medio
- 5 h 13 min
- PR fusionados (30 d)
- 181
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fglock/PerlOnJava
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
fglock/PerlOnJava#1651 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fglock/PerlOnJava#1579 ·
Los mantenedores suelen responder en 1 día
-
area:cpan-port area:unicode bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
fglock/PerlOnJava#1341 ·
Los mantenedores suelen responder en 1 día
-
area:cpan-port area:parser bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
fglock/PerlOnJava#1685 ·
Los mantenedores suelen responder en 1 día
-
area:cpan-port area:runtime bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
fglock/PerlOnJava#1684 ·
Los mantenedores suelen responder en 1 día
Todos los issues de fglock/PerlOnJava
Issues similares
-
FOODTURE
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
openfoodfacts/openfoodfacts-server#14853 ·
Los mantenedores suelen responder en 1 día
-
Needs Triage
Dificultad 2/5 Medio día Aptitud para principiantes 66/100
Perl/perl5#24913 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Perl/Fish oddness in new versionAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
gugod/App-perlbrew#879 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
RotherOSS/otobo#6205 · 1 comentario ·
Los mantenedores suelen responder en 1 día