Reading a field of a class declared later in the file loses its refinement
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
- 領域
- compilers, testing-qa
調査の方向性
Start with RefinementTypeChecker.visitCtField and visitCtFieldRead, which the issue identifies as the source-order context handling path. Use the supplied ReadBefore reproducer to confirm the false “not enough information” error, then compare it with the version where Job is declared earlier. Done means the reproducer reports “Correct! Passed Verification.” and reads still work when the class is declared later.
索引モデルが issue の本文から書いたものです。
説明
Description
Reading a field of an object whose class is declared later in the file does not pick up the field's refinement, so a correct program fails with a false "not enough information" error. Writes to such fields are handled by #314 (fixing #308); reads are not.
Minimal reproducer
import liquidjava.specification.Refinement;
public class ReadBefore {
private final Job job = new Job();
@Refinement("_ >= 0")
public int get() { return job.port; }
static class Job { @Refinement("_ >= 0") int port; }
}
Expected
Correct! Passed Verification.
Actual
Refinement Error: true is not a subtype of #ret² >= 0
5 | public int get() { return job.port; }
| ^^^^^^^^^^^^^^^^
--> Not enough information to prove the expected refinement. Add a refinement or condition to constrain it.
Moving Job above get makes it pass.
Cause
Fields enter the context only in the second pass (RefinementTypeChecker.visitCtField), in source order. When job.port is read, this#port is not in context yet, so visitCtFieldRead falls through to new Predicate() (no information).
Reproduced on main at fbfb4e23 (liquidjava-verifier 0.0.35), and on the #314 branch.
- 主要言語
- Java
- スター
- 67
- フォーク
- 36
- 平均マージ
- 4日 17時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
liquid-java/liquidjava のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
liquid-java/liquidjava#321 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
liquid-java/liquidjava#323 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
liquid-java/liquidjava#322 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
liquid-java/liquidjava#318 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
liquid-java/liquidjava#317 ·
メンテナーはふだん 2 日以内に返信
liquid-java/liquidjava の issue をすべて見る
似ている issue
-
Update license yearオープン0 - Backlog 1 - Ready documentation good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
cbor
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
FasterXML/jackson-dataformats-binary#844 ·
メンテナーはふだん 1 日以内に返信
-
Issue: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
OpenAPITools/openapi-generator#25107 ·
メンテナーはふだん 1 日以内に返信
-
improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/iceberg#18351 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
repowise-dev/repowise#2945 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信