diff --git a/lang/src/son.rs b/lang/src/son.rs index e816810aa..1e6740207 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -2486,6 +2486,12 @@ impl<'a> Codegen<'a> { } } Expr::Bool { value, .. } => Some(self.ci.nodes.new_const_lit(ty::Id::BOOL, value)), + Expr::Number { value, .. } + if let Some(ty) = ctx.ty + && ty.is_float() => + { + Some(self.ci.nodes.new_const_lit(ty, (value as f64).to_bits() as i64)) + } Expr::Number { value, .. } => Some( self.ci.nodes.new_const_lit( ctx.ty