diff --git a/src/triangular.jl b/src/triangular.jl index 10925565..e1267ee3 100644 --- a/src/triangular.jl +++ b/src/triangular.jl @@ -256,16 +256,15 @@ Base.@constprop :aggressive @propagate_inbounds function getindex(A::Union{Lower _shouldforwardindex(A, b) ? A.data[b] : diagzero(A.data, b) end -_zero_triangular_half_str(::Type{<:UpperOrUnitUpperTriangular}) = "lower" -_zero_triangular_half_str(::Type{<:LowerOrUnitLowerTriangular}) = "upper" +_zero_triangular_half_str(T::Type) = T <: UpperOrUnitUpperTriangular ? "lower" : "upper" -@noinline function throw_nonzeroerror(T, @nospecialize(x), i, j) +@noinline function throw_nonzeroerror(T::DataType, @nospecialize(x), i, j) Ts = _zero_triangular_half_str(T) Tn = nameof(T) throw(ArgumentError( lazy"cannot set index in the $Ts triangular part ($i, $j) of an $Tn matrix to a nonzero value ($x)")) end -@noinline function throw_nononeerror(T, @nospecialize(x), i, j) +@noinline function throw_nononeerror(T::DataType, @nospecialize(x), i, j) Tn = nameof(T) throw(ArgumentError( lazy"cannot set index on the diagonal ($i, $j) of an $Tn matrix to a non-unit value ($x)")) @@ -311,7 +310,7 @@ end return A end -@noinline function throw_setindex_structuralzero_error(T, @nospecialize(x)) +@noinline function throw_setindex_structuralzero_error(T::DataType, @nospecialize(x)) Ts = _zero_triangular_half_str(T) Tn = nameof(T) throw(ArgumentError(