Skip to content

Throw useful error when there is no comparison operator in Separator #156

@dpsanders

Description

@dpsanders
julia> using IntervalConstraintProgramming, ModelingToolkit

julia> f(x) = (x - 0.2)*(x - 0.8)
f (generic function with 1 method)

julia> vars = @variables x
(x,)

julia> Separator(vars, f)
ERROR: MethodError: no method matching iterate(::Nothing)
Closest candidates are:
  iterate(::Core.SimpleVector) at essentials.jl:600
  iterate(::Core.SimpleVector, ::Any) at essentials.jl:600
  iterate(::ExponentialBackOff) at error.jl:218
  ...
Stacktrace:
 [1] indexed_iterate(::Nothing, ::Int64) at ./tuple.jl:66
 [2] Separator(::Tuple{Operation}, ::Operation) at /Users/dpsanders/.julia/packages/IntervalConstraintProgramming/ta93g/src/separator.jl:199
 [3] Separator(::Tuple{Operation}, ::Function) at /Users/dpsanders/.julia/packages/IntervalConstraintProgramming/ta93g/src/separator.jl:205
 [4] top-level scope at REPL[6]:1

cc @Yashcodes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions