Skip to content

Commit

Permalink
fixed need_transforms_relaxation
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed Jan 26, 2024
1 parent 32a2d31 commit b3bb42d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/varnamevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ function need_values_relaxation(vnv::VarNameVector, vns, vals)
end

function need_transforms_relaxation(vnv::VarNameVector, vn::VarName, val)
if isconcretetype(eltype(vnv.transforms))
return if isconcretetype(eltype(vnv.transforms))
# If the container is concrete, we need to make sure that the sizes match.
# => If the sizes don't match, we need to relax the container type.
return any(keys(vnv)) do vn_present
any(keys(vnv)) do vn_present
size(vnv[vn_present]) != size(val)
end
elseif eltype(vnv.transforms) !== Any
# If it's not concrete AND it's not `Any`, then we should just make it `Any`.
true
else
# Otherwise, it's `Any`, so we don't need to relax the container type.
false
end

return false
end
function need_transforms_relaxation(vnv::VarNameVector, vns, vals)
return any(need_transforms_relaxation(vnv, vn, val) for (vn, val) in zip(vns, vals))
Expand Down

0 comments on commit b3bb42d

Please sign in to comment.