Lower boolean-to-float conversions without invalid Whale casts
メンテナーはふだん 1 日以内に返信
@SUJALSPATEL がすでに取り組んでいます。
2026年10月9日 から。
評価
この issue はまだ評価されていません。
説明
Problem
Casting a bool to f32/f64 emits IToF_U directly from Whale Type::Bool. Upstream rejects that cast, so valid Wave code fails with an internal compiler error and no source span. LLVM accepts it; bool-to-integer conversions already work in Whale.
Reproduction
Audited on Linux amd64 at 53bb5809cf32d29f5a5a9d313ffa332ea3cd4beb, whose tracked tree matches canonical master c5ab63f9eec388c75b00f5cd59eae28a45a9b39f. Compiler built with Rust 1.89.0, LLVM 21, and the checkout std; Whale is locked to 020d2a4. Executed both CLI paths:
fun main() {
var flag: bool = true;
var value: f64 = flag as f64;
}
wavec check bool_float.wave
wavec --whale check bool_float.wave --error-format=json
LLVM exits 0. Whale exits 1 with E4001: internal compiler error in Whale lowering: Whale IR verification failed: InvalidCast { ... op: IToF_U, source: Bool, destination: F64 } and line/column 0. Reproduced with f32 as well; i8/u8/i64/u128 destinations passed.
Scope
Start at whale/src/codegen/expression.rs convert for ConversionKind::UnsignedToFloat. Follow HIR's existing bool-to-float decision and preserve false=0.0/true=1.0; use a valid upstream instruction sequence rather than weakening verification or changing frontend semantics. Starting regressions: tests/whale_backend.rs. Difficulty: easy.
Completion criteria
- Explicit and accepted implicit bool-to-f32/f64 conversions produce verified IR.
- Cover true/false, variable/function operands, ordered surrounding casts, and single evaluation.
- Existing integer/float conversion guards and LLVM behavior remain intact.
- 主要言語
- Rust
- スター
- 56
- フォーク
- 21
- 平均マージ
- 23時間 20分
- マージ済み PR(30日)
- 45
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wavefnd/Wave のほかの issue
-
Reject unrepresentable POSIX listener descriptors before Unix-domain accept対応中かも @ShahadatTest が 6 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
wavefnd/Wave#1082 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Preserve expression assembly result types when recording HIR conversions対応中かも @hiyouwhatsapp が 2 日前に担当しました。 オープンbug help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
bug help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 53/100
メンテナーはふだん 1 日以内に返信
-
Preserve the previous build output when writing its Cargo receipt fails対応中かも @hiyouwhatsapp が 2 日前に担当しました。 オープンbug build help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
メンテナーはふだん 1 日以内に返信
-
Reconcile obsolete staging assets before verifying a new Nightly generation対応中かも @hiyouwhatsapp が 2 日前に担当しました。 オープンbug ci help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
Panic on live viewport resize when unstyled elements exist in display: none subtree対応中かも @GoCoder7 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DioxusLabs/blitz#1488 ·
メンテナーはふだん 1 日以内に返信
-
🏷️ good first issue enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
S-Needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
vectordotdev/vrl#2042 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信