False error: a call used as an operand loses the link between its return refinement and its arguments
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 40/100
Hướng nghiên cứu
Start with OperationsChecker, the invocation case for operand refinements, and see how it calls RefinedFunction.getRenamedRefinements, which renames parameters to their last instances. Compare with MethodsFunctionsChecker, which maps arguments to parameters, and reproduce with the Inc class from the issue. Done means inc(2) + 1 and size(arr) + 1 verify while the direct assignment cases still pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Impact: correct code is rejected (false error) whenever a method's return refinement mentions its parameters and the call is an operand of an expression. Found while addressing a review comment on #400.
Description
OperationsChecker (the invocation case of operand refinements) takes the function's refinements via RefinedFunction.getRenamedRefinements, which renames each parameter to its last instance rather than to the call's arguments. When the call is an operand (inc(2) + 1), the parameters are never bound to the arguments, so the return refinement keeps the bare parameter name. The same call assigned directly (int k = inc(2);) works.
Minimal reproducer
import liquidjava.specification.Refinement;
class Inc {
@Refinement("_ == x + 1")
static int inc(int x) { return x + 1; }
@Refinement("_ == length(xs)")
static int size(int[] xs) { return xs.length; }
void m() {
@Refinement("_ == 4") int k = inc(2) + 1;
int[] arr = new int[2];
@Refinement("_ == 3") int j = size(arr) + 1;
}
}
Expected
Correct! Passed Verification.
Actual (main ad055b49)
Refinement Error: k⁷ == x + 2 is not a subtype of k⁷ == 4
Possible fix
For an invocation operand, check the call like a standalone invocation (MethodsFunctionsChecker, which maps arguments to parameters, including spread varargs since #400) and use the resulting refinement of the call, instead of the function's refinements with parameters renamed to their last instances.
- Ngôn ngữ chính
- Java
- Star
- 69
- Fork
- 36
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của liquid-java/liquidjava
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
liquid-java/liquidjava#395 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Verifier crashes on a comparison or other binary operator whose operand types cannot be resolved (classes not on the classpath)Có thể đã có người làm @CatarinaGamboa đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
liquid-java/liquidjava#388 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
liquid-java/liquidjava#373 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Soundness: a local variable with a constant's name shadows the constant (Format.JPG read as local JPG)Có thể đã có người làm @CatarinaGamboa đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
liquid-java/liquidjava#321 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
liquid-java/liquidjava#406 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của liquid-java/liquidjava
Issue tương tự
-
approved bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
checkstyle/checkstyle#21981 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` keyCó thể đã có người làm @aphenix-r7 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
MCModderAnchor/TACZ#758 ·
-
agent-java community triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
elastic/apm-agent-java#4594 ·
Maintainer thường phản hồi trong vòng 1 ngày