Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Report malformed Object::Pad BUILD declarations clearly

Đang mở
#1,808 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl
Lĩnh vực
compilers

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Perl
Star
64
Fork
7
Merge trung bình
5 giờ 25 phút
Pull request đã merge (30 ngày)
213

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.