Rust printer: Statement.getBasichead() printed as 'return self' in both branches
まだ誰も着手していません。
評価
調査の方向性
Start with the Rust translation of Statement.getBasichead() in the fernflower reproduction and trace how the Shared<Statement> field first is translated through recursive calls returning &Self. Compare the generated Rust with the Java branches and inspect build_continue_set and is_head_do_statement to understand the impact. Done means the translated else branch preserves the recursive call and the translation report identifies any remaining unsupported behavior.
索引モデルが issue の本文から書いたものです。
説明
On fernflower (test-oss/fernflower, translated with --translate rust), Statement.getBasichead() is printed with self in both branches:
public BasicBlockStatement getBasichead() {
if (type == StatementType.BASIC_BLOCK) {
return (BasicBlockStatement)this;
}
else {
return first.getBasichead();
}
}
pub fn get_basichead(&self) -> &Self {
if self.r#type == StatementStatementType::BasicBlock {
return self;
} else {
return self;
}
}
It compiles, so rustc does not catch it, and the translation report has no message for these lines. The recursion into first is gone. Callers that build continue-sets from it (build_continue_set, is_head_do_statement) inherit the wrong result.
The setting:
Statementis the root of a closed hierarchy, andBasicBlockStatementis a member of it.firstisOption<crate::jrt::Shared<Statement<'a>>>.
A small reproduction with a plain field, then with a nullable field and a member cast (return (Leaf) this / return first.head()), prints the recursion correctly. So the trigger is probably the Shared handle, or the &Self return through it. It is not the cast.
Found while reviewing the printed bodies against the Java.
🤖 Generated with Claude Code
- 主要言語
- Java
- スター
- 1
- フォーク
- 1
- 平均マージ
- 48分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeLaser/maddi のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Javadoc warnings are the only noise on an otherwise clean CI run再び着手できるかも @jayeshamundkar06-bit が 27 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbuild/ci good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
CodeLaser/maddi の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
federicoiosue/Omni-Notes#1044 ·
-
Bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Terraform releases proxy leaves a temp folder behind on every cache refresh対応中かも @dhananjay6561 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
terrakube-io/terrakube#4069 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
find-sec-bugs/find-sec-bugs#789 ·