Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message when accidentally repeating type parameters #33199

Closed
drop2voicing opened this issue Sep 9, 2019 · 3 comments
Closed
Labels
domain:error handling Handling of exceptions by Julia or the user

Comments

@drop2voicing
Copy link

drop2voicing commented Sep 9, 2019

Maybe this could be related to the legacy curly-brace array syntax?

julia> struct Foo
       a :: Vector{String}{String}
       end
ERROR: TypeError: in Type{...} expression, expected UnionAll, got Type{Array{String,1}}
Stacktrace:
 [1] top-level scope at none:0

The actual problem is glaringly obvious in this example, but this is distilled from a much more complicated example I encountered in the wild involving bad code generation, where the puzzling error message made me briefly want to rage quit this whole programming thing.

I didn't find any reports that appeared directly related to this issue, though #18096 could be tangentially related?

@yuyichao
Copy link
Contributor

yuyichao commented Sep 9, 2019

FYI, the syntax is actually valid.

julia> Array{String}{1}
Array{String,1}

Edit: What I mean is that the "actual" problem might not be as obvious as what you thought.

@stevengj stevengj added the domain:error handling Handling of exceptions by Julia or the user label Sep 9, 2019
@JeffBezanson
Copy link
Sponsor Member

Thanks for reporting. Do you have a suggestion for a better wording? I could propose some, but would be useful to know what you would have found helpful.

@vtjnash vtjnash closed this as completed Feb 3, 2024
@vtjnash
Copy link
Sponsor Member

vtjnash commented Feb 3, 2024

I can't really think of how to make this clearer. We should have slightly more accurate line info now, though we have existing issues about improving that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

5 participants