Lower boolean-to-float conversions without invalid Whale casts
Los mantenedores suelen responder en 1 día
@SUJALSPATEL ya está trabajando en esto.
Desde el 9/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 56
- Forks
- 21
- Merge medio
- 23 h 20 min
- PR fusionados (30 d)
- 45
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wavefnd/Wave
-
Reject unrepresentable POSIX listener descriptors before Unix-domain acceptPosiblemente ocupada @ShahadatTest la tomó hace 6 días. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
wavefnd/Wave#1082 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Preserve expression assembly result types when recording HIR conversionsPosiblemente ocupada @hiyouwhatsapp la tomó hace 2 días. Abiertobug help wanted
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
bug help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 53/100
Los mantenedores suelen responder en 1 día
-
Preserve the previous build output when writing its Cargo receipt failsPosiblemente ocupada @hiyouwhatsapp la tomó hace 2 días. Abiertobug build help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
Los mantenedores suelen responder en 1 día
-
Reconcile obsolete staging assets before verifying a new Nightly generationPosiblemente ocupada @hiyouwhatsapp la tomó hace 2 días. Abiertobug ci help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
Todos los issues de wavefnd/Wave
Issues similares
-
Panic on live viewport resize when unstyled elements exist in display: none subtreePosiblemente ocupada @GoCoder7 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DioxusLabs/blitz#1488 ·
Los mantenedores suelen responder en 1 día
-
🏷️ good first issue enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
S-Needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
vectordotdev/vrl#2042 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día