From 939beb28b510eb79e6e1e698ed5fbe70999bb813 Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Thu, 23 Nov 2023 15:16:31 +0100 Subject: [PATCH] constructor --- src/Dimensions/dimension.jl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Dimensions/dimension.jl b/src/Dimensions/dimension.jl index e45ea4648..145cbf138 100644 --- a/src/Dimensions/dimension.jl +++ b/src/Dimensions/dimension.jl @@ -341,12 +341,15 @@ struct Dim{S,T} <: Dimension{T} end new{S,typeof(val)}(val) end -end -function Dim{S}(val::AbstractArray; kw...) where S - if length(kw) > 0 - val = AutoLookup(val, values(kw)) + function Dim{S}(val::AbstractArray; kw...) where S + if length(kw) > 0 + val = AutoLookup(val, values(kw)) + end + Dim{S,typeof(val)}(val) + end + function Dim{S,T}(val::T) where {S,T} + new{S,T}(val) end - Dim{S,typeof(val)}(val) end Dim{S}() where S = Dim{S}(:)