False error: @StateSet on a nested class gives "Argument Mismatch Error: ... expected Inner, got Inner"
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.”
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Java
- スター
- 71
- フォーク
- 37
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 46
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
liquid-java/liquidjava のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
liquid-java/liquidjava#443 ·
メンテナーはふだん 2 日以内に返信
-
bug real-world-finding
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
liquid-java/liquidjava#395 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
liquid-java/liquidjava#373 ·
メンテナーはふだん 2 日以内に返信
-
bug error messages
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
liquid-java/liquidjava#471 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 69/100
liquid-java/liquidjava#470 ·
メンテナーはふだん 2 日以内に返信
liquid-java/liquidjava の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
LtByXsl throws NoSuchElementException when defect element has no text content対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
objectionary/lints#1640 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
virtualcell/vcell#2193 ·
メンテナーはふだん 1 日以内に返信