From f1fe52325ec4f9f980b877e219b626da6872ae46 Mon Sep 17 00:00:00 2001 From: Kris Brown Date: Tue, 8 Oct 2024 14:44:47 -0700 Subject: [PATCH] fix bug in migrations when there are different sorts --- src/models/ModelInterface.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/models/ModelInterface.jl b/src/models/ModelInterface.jl index 6d008bab..d1b2d6e6 100644 --- a/src/models/ModelInterface.jl +++ b/src/models/ModelInterface.jl @@ -652,6 +652,10 @@ function migrator(tmap, dom_module, codom_module, dom_theory, codom_theory) v => whereparamdict[AlgSort(tmap(v.method).val)] end) + whereparams2 = map(sorts(dom_theory)) do v + whereparamdict[AlgSort(tmap(v.method).val)] + end + # Create input for instance_code ################################ accessor_funs = JuliaFunction[] # added to during typecon_funs loop @@ -729,11 +733,12 @@ function migrator(tmap, dom_module, codom_module, dom_theory, codom_theory) ) tup_params = Expr(:curly, :Tuple, whereparams...) + tup_params2 = Expr(:curly, :Tuple, whereparams2...) model_expr = Expr( :curly, GlobalRef(Syntax.TheoryInterface, :Model), - tup_params + tup_params2 # Types associated with *domain* sorts ) # The second whereparams needs to be reordered by the sorts of the DOM theory