False error: @StateSet on a nested class gives "Argument Mismatch Error: ... expected Inner, got Inner"
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start with TypeChecker.createStateGhost, then follow how GhostFunction and Utils handle the nested-class name Outer$Inner; Expression.throwArgumentMismatchError explains the reported type mismatch. Reproduce using the issue's Java example and compare with the top-level Inner case; done when the nested-class example verifies with “Correct! Passed Verification.”
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Impact: typestates on a nested class cannot be used: every state refinement of it fails with a self-contradictory message (expected Inner, got Inner) and no source location. The same class at top level verifies.
Minimal reproducer
import liquidjava.specification.StateRefinement;
import liquidjava.specification.StateSet;
public class Outer {
@StateSet({"fresh", "ready"})
static class Inner {
@StateRefinement(to = "ready(this)")
public Inner() {}
@StateRefinement(from = "ready(this)", to = "fresh(this)")
public void use() {}
}
static void ok() {
Inner i = new Inner();
i.use();
}
}
Expected: Correct! Passed Verification., as for the same Inner as a top-level class.
Actual (main @ 0053074e; this is the whole output, with no code snippet):
Argument Mismatch Error: Argument '#this_1' and its respective parameter of ghost 'Outer$Inner.state1' types are incompatible: expected Inner, got Inner
Cause. TypeChecker.createStateGhost gives the stateN ghost the parameter type type.getSimpleName() (Inner). GhostFunction swaps that for the prefix only when it equals Utils.getSimpleName(prefix), which splits on . only, so for Outer$Inner it is Outer$Inner and the swap does not happen. The parameter type stays an unresolved reference to Inner, which is neither equal to nor a supertype of Outer$Inner in Expression.throwArgumentMismatchError; both print as Inner. Related: the $ vs . naming of nested classes also breaks @Ghost on them (Z3 sort mismatch, #467).
🤖 Generated with Claude Code
- Ngôn ngữ chính
- Java
- Star
- 71
- Fork
- 37
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 46
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
liquid-java/liquidjava#443 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug real-world-finding
Độ 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
-
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
-
bug error messages
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
liquid-java/liquidjava#471 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 69/100
liquid-java/liquidjava#470 ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một 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 1-3 giờ Mức phù hợp với người mới 84/100
objectionary/lints#1640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
virtualcell/vcell#2193 ·
Maintainer thường phản hồi trong vòng 1 ngày