From 5234453662c8ad1f99d8f8f04996b9bc153a73b8 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Fri, 11 Oct 2024 12:42:51 +0100 Subject: [PATCH] Default float type to float(Real), not Real Closes #684 --- Project.toml | 2 +- src/utils.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 5830de123..8e2cb92e2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DynamicPPL" uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8" -version = "0.28.4" +version = "0.28.5" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/utils.jl b/src/utils.jl index 4bf652363..4bf5d183b 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -811,9 +811,9 @@ end """ float_type_with_fallback(x) -Return type corresponding to `float(typeof(x))` if possible; otherwise return `Real`. +Return type corresponding to `float(typeof(x))` if possible; otherwise return `float(Real)`. """ -float_type_with_fallback(::Type) = Real +float_type_with_fallback(::Type) = float(Real) float_type_with_fallback(::Type{T}) where {T<:Real} = float(T) """