diff --git a/src/parameters_base.jl b/src/parameters_base.jl index 61c17d4..dfbc54d 100644 --- a/src/parameters_base.jl +++ b/src/parameters_base.jl @@ -18,3 +18,4 @@ value(x::AbstractArray) = map(value, x) value(x::Tuple) = map(value, x) value(x::NamedTuple) = map(value, x) value(x::Dict) = Dict(k => value(v) for (k, v) in x) +value(::Nothing) = nothing diff --git a/test/parameters.jl b/test/parameters.jl index 6f8e17a..7df5d2d 100644 --- a/test/parameters.jl +++ b/test/parameters.jl @@ -62,7 +62,7 @@ end @testset "value_flatten" begin - x = (ones(3), fixed(5.0), (a=fixed(5.0), b=[6.0, 2.1])) + x = (ones(3), fixed(5.0), (a=fixed(5.0), b=[6.0, 2.1]), nothing) v, unflatten = value_flatten(x) @test length(v) == 5