Better error message for convert(Type{Union{}}, ...)
#40951
Labels
Comments
|
Yes, we already have a function |
|
Ref #36706 |
|
I would like to contribute to this issue, will be grateful for guidance to approach this. @JeffBezanson @eschnett @jakobnissen |
|
@kahanikaar are you working on this issue? |
|
Hi @eschnett, thanks for filing the issue. Could you please help me by providing a MWE to reproduce it? It would help me understand what's going on behind the scenes here. |
|
Try this: convert(Union{}, Float32[]) |
|
Not quite sure but does fixing this issue start with modifying this? Line 216 in 87e08d9 I am kinda new to error handling so any help would be appreciated. Logic says whenever this is encountered, we need to redirect it to show_convert_error function as @JeffBezanson mentioned.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


I received this error message:
This is a confusing error message. Would it be possible to catch this as a special case in the definition of
convert, and emit an error such as "Converting toUnion{}" does not make sense; check your call site"?The text was updated successfully, but these errors were encountered: