Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Report malformed Object::Pad BUILD declarations clearly

Aperta
#1,808 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, perl
Ambito
compilers

Direzione di ricerca

Start with the class-block parser in the Perl front end, where BUILD is recognized and where a missing block body falls through into expression parsing. Reproduce with class BadBuild { BUILD method value {} } under use Object::Pad; and confirm the current unblessed-reference error. Done when that input yields a targeted syntax diagnostic, out-of-class BUILD gets coverage, and valid BUILD blocks still pass the existing Object::Pad tests.

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

Descrizione

Context

PR #1804 added support for valid Object::Pad BUILD { ... } blocks, including execution after field initialization, and passed the CAD::OpenSCAD 0.14 acceptance tests on both JVM and interpreter backends. The original parser failure is fixed.

Remaining diagnostic gap

Malformed or misplaced BUILD syntax should receive a focused compile-time diagnostic. Today, an incomplete class block can fall through into ordinary expression parsing and fail later with a confusing runtime error.

For example, against the merged implementation:

use Object::Pad;
class BadBuild { BUILD method value {} }

currently reports Can't call method "value" on unblessed reference instead of identifying the malformed BUILD declaration.

Follow-up

  • Detect BUILD in a class block when it is not followed by a block body and report a targeted syntax diagnostic.
  • Add project-owned coverage for malformed and out-of-class BUILD declarations.
  • Keep valid Object::Pad BUILD blocks and their constructor behavior unchanged.

Related: #1450, PR #1804.

Lingua principale
Perl
Stelle
64
Fork
7
Merge medio
5h 39m
PR unite (30g)
213

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.