From 6099eb4c68be6472653ecbde26f20832b337e321 Mon Sep 17 00:00:00 2001 From: Tortar Date: Tue, 30 Jul 2024 20:06:59 +0200 Subject: [PATCH] fix --- src/core/agents.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/agents.jl b/src/core/agents.jl index 7964808204..cbdbe581bb 100644 --- a/src/core/agents.jl +++ b/src/core/agents.jl @@ -315,6 +315,13 @@ macro multiagent(typedef) model to use the new methodology." return esc(_multiagent(QuoteNode(:opt_speed), typedef)) else - return esc(:($DynamicSumTypes.@sumtype $typedef)) + if typedef.head === :call + abstract_type = :AbstractAgent + type_with_variants = typedef + elseif typedef.head === :(<:) + abstract_type = typedef.args[2] + type_with_variants = typedef.args[1] + end + return esc(:($DynamicSumTypes.@sumtype $type_with_variants <: $abstract_type)) end end