Skip to content

Commit

Permalink
better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ogauthe committed Oct 24, 2024
1 parent 36c076f commit 65453b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NDTensors/src/lib/SymmetrySectors/src/sector_product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ end
function arguments_product(s1, s2)
isempty(s1) && return s2
isempty(s2) && return s1
throw(ArgumentError("Mixing implementations is illegal"))
throw(ArgumentError("Mixing non-empty storage types is illegal"))
end

arguments_isless(s1, s2) = isless(sym_arguments_insert_unspecified(s1, s2)...)
function arguments_isless(t::Tuple, nt::NamedTuple)
isempty(nt) && return arguments_isless(t, ())
isempty(t) && return arguments_isless((;), nt)
throw(ArgumentError("Mixing Tuple and NamedTuple is illegal"))
throw(ArgumentError("Mixing non-empty storage types is illegal"))
end
function arguments_isless(nt::NamedTuple, t::Tuple)
isempty(nt) && return arguments_isless((), t)
isempty(t) && return arguments_isless(nt, (;))
throw(ArgumentError("Mixing Tuple and NamedTuple is illegal"))
throw(ArgumentError("Mixing non-empty storage types is illegal"))
end

# ================================= Cartesian Product ====================================
Expand Down

0 comments on commit 65453b6

Please sign in to comment.