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

Prevent accidental proc overwriting, proc signature overloads

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

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu bằng cách đọc hai đề xuất và phần thảo luận về ngữ nghĩa của final, overwritable và overwrites. Issue không nêu tệp, bài kiểm thử hay điểm vào nào, và việc hoàn thành phụ thuộc vào quyết định về hành vi của các từ khóa, đánh giá việc khớp chữ ký, cũng như tiến hành nghiên cứu người dùng hoặc thu thập telemetry trước khi triển khai.

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

Mô tả

discussion wanted feature request

A discussion came up about being able to overwrite procs. There are definitely good use cases for being able to overwrite procs, but the discussion was that perhaps this is not a good thing by default/generally.

A number of proposals were offered, summarized here. For clarity, the term "final" is taken to mean that a proc cannot be overwritten, whether or not there is a keyword final involved.

  1. No change in existing behavior, but a new keyword final is introduced, and when applied to procs, prevents them from being overwritten elsewhere.
  • Pros: No user code has to change. The implementation is simpler, and doesn't require a phase in period.
  • Cons: If a user is accidentally overwriting a proc when they didn't mean to, this feature will not benefit them.
  1. Add overwrites/overwritable/overwrite keyword(s). This changes existing behavior, so that all procs are final by default, but procs that are marked with some combination of either/both overwrites and/or overwritable are allowed to be overwritten.
  • Pros: It's impossible for users to miss accidental overwrites, as this is much stricter.
  • Cons: Behavior change, requires users to change code and requires a phase in period. It seems unlikely that this would be a widespread problem, but in general this would require a phase in period, and we should create telemetry on this to count how many people are affected, and the magnitude that they are affected before making this functionality visible to users at all.

For option 2, there is still a need to determine the specific keywords that are used. Do you put the overwritable keyword on the "master" proc, and the overwrites keyword on the sub-proc? Or do you just have a single keyword overwrite which you tag on all procs that are intended on being overwritten and the procs that overwrite them? This is a minor discussion that needs to happen still, but does not materially change the overall decision.

Another discussion is to also perform signature matching on non-final procs. So redefining a proc (which is either implicitly or explicitly overwritable) with a new signature should be disallowed. I generally support this, but this is a different decision and implementation. This may however prevent valid use case, so further user research needs to be done to provide input to this decision.

Ngôn ngữ chính
Java
Star
128
Fork
70
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 EngineHub/CommandHelper

Tất cả issue của EngineHub/CommandHelper

Issue tương tự

Thêm issue về Java

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.