Skip to content

Commit

Permalink
CLEANUP: Work around odd type inference problem in new Julia v1.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
epatters committed Dec 3, 2021
1 parent ce34fc6 commit d0ee4b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/wiring_diagrams/Algebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ box/junction attributes. The default attributes are those compatible with the
function oapply(composite::UndirectedWiringDiagram, hom_map::AbstractDict,
ob_map::Union{AbstractDict,Nothing}=nothing;
hom_attr::Symbol=:name, ob_attr::Symbol=:variable)
homs = [ hom_map[name] for name in subpart(composite, hom_attr) ]
# XXX: Julia should be inferring these vector eltypes but isn't on v1.7.
homs = valtype(hom_map)[ hom_map[name] for name in composite[hom_attr] ]
obs = isnothing(ob_map) ? nothing :
[ ob_map[name] for name in subpart(composite, ob_attr) ]
valtype(ob_map)[ ob_map[name] for name in composite[ob_attr] ]
oapply(composite, homs, obs)
end

Expand Down Expand Up @@ -99,7 +100,9 @@ function oapply(composite::UndirectedWiringDiagram,
end
end
end
diagram[:ob₁] = map(L, junction_feet)
for (j, foot) in enumerate(junction_feet)
diagram[j, :ob₁] = L(foot)
end

# Find, or if necessary create, an outgoing edge for each junction. The
# existence of such edges is an assumption for colimits of bipartite diagrams.
Expand Down

0 comments on commit d0ee4b2

Please sign in to comment.