JuliaMath / JuliaMath/IntervalSets.jl
Conversion to complex should throw an error
- Dominant language
- Julia
- Stars
- 109
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
The following behaviour is problematic:
```julia
julia> d = convert(AbstractInterval{ComplexF64}, 0..1)
0.0 + 0.0im..1.0 + 0.0im
julia> 0.5 in d
ERROR: MethodError: no method matching isless(::Complex{Float64}, ::Float64)
Closest candidates are:
isless(::Float64, ::Float64) at float.jl:459
isless(::Missing, ::Any) at missing.jl:66
isless(::AbstractFloat, ::AbstractFloat) at operators.jl:148
...
Stacktrace:
[1] <(::Complex{Float64}, ::Float64) at ./operators.jl:260
[2] <=(::Complex{Float64}, ::Float64) at ./operators.jl:309
[3] in(::Float64, ::Interval{:closed,:closed,Complex{Float64}}) at /Users/sheehanolver/.julia/packages/IntervalSets/xr34V/src/IntervalSets.jl:126
[4] top-level scope at none:0
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.