Open bkamins opened 2 years ago
Good point. I'd say that the problem here is that the x:y:z
syntax dispatches to StepRange
despite the fact that y
is floating point. An error should probably be thrown earlier, without mentioning StepRange
, since the user didn't ask for it at any point. Printing the type of all three values would help users understand the problem.
Yes, the reason is that the method upstream expects x
and z
to have the same type only.
Most likely we need to add a method with Missing
being a specific type and throw an error in that case.
BTW a related issue is https://github.com/JuliaLang/julia/issues/46244.
Note that also:
julia> 0.1:0.1:missing
ERROR: MethodError: no method matching (::Colon)(::Float64, ::Float64, ::Missing)
is I think OK.
@nalimilan - this is a common error.
First a case when I think error message is OK (or at least acceptable):
Now a case when new users will be confused:
Source why it is common: