You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<<(x::Integer, c::Unsigned) = c <=typemax(UInt) ? x << (c % UInt) :zero(x)
loops. For example
julia> using GeometryTypes
julia> OffsetInteger{-1}(3) << UInt(2)
ERROR: StackOverflowError:
Stacktrace:
[1] <<(::OffsetInteger{-1,Int64}, ::UInt64) at ./operators.jl:568 (repeats 80000 times)
or, self-contained
julia> struct A <: Integer
end
julia> A() << UInt(2)
ERROR: StackOverflowError:
Stacktrace:
[1] <<(::A, ::UInt64) at ./operators.jl:568 (repeats 80000 times)
Obviously, to get << working, I need to define an additional method, which would be more specific and prevent infinite recursion. So I'm not sure if this counts as a bug. Making an issue just in case there's a way to fix it to get a MethodError instead.
The definition
julia/base/operators.jl
Line 568 in 89a2c08
loops. For example
or, self-contained
Obviously, to get
<<
working, I need to define an additional method, which would be more specific and prevent infinite recursion. So I'm not sure if this counts as a bug. Making an issue just in case there's a way to fix it to get aMethodError
instead.Related: #26552
The text was updated successfully, but these errors were encountered: