From 45a4c4f342db5e5ac301777b161aa3516a72543d Mon Sep 17 00:00:00 2001 From: Tengis Dashmunkh Date: Tue, 26 Mar 2024 11:48:04 -0600 Subject: [PATCH] adding the outer constructor back --- src/system_descriptor.jl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/system_descriptor.jl b/src/system_descriptor.jl index 70e41a5..e07b286 100644 --- a/src/system_descriptor.jl +++ b/src/system_descriptor.jl @@ -3,12 +3,24 @@ struct SystemArgument default::Any allowed_values::Set{<:Any} - function SystemArgument(; name, default, allowed_values) + function SystemArgument(name, default, allowed_values) isempty(allowed_values) && error("allowed_values cannot be empty") new(name, default, allowed_values) end end +function SystemArgument(; + name, + default, + allowed_values +) + return SystemArgument( + name, + default, + allowed_values + ) +end + get_name(arg::SystemArgument) = arg.name get_default(arg::SystemArgument) = arg.default get_allowed_values(arg::SystemArgument) = arg.allowed_values