Skip to content

Commit

Permalink
fix bug in migrations when there are different sorts
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Brown committed Dec 8, 2024
1 parent 1b42e18 commit 4c86234
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/models/ModelInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,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
Expand Down Expand Up @@ -726,11 +730,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
Expand Down

0 comments on commit 4c86234

Please sign in to comment.