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

improve error message for new missing type parameters. #431

Open
oscardssmith opened this issue May 9, 2024 · 2 comments
Open

improve error message for new missing type parameters. #431

oscardssmith opened this issue May 9, 2024 · 2 comments
Labels

Comments

@oscardssmith
Copy link
Member

Currently the following code

struct A{T}
    t::T
    function A(t)
        new(t)
    end
end

produces the syntax error

ERROR: syntax: too few type parameters specified in "new{...}" around REPL[3]:1
Stacktrace:
[1] top-level scope
  @ REPL[3]:1

This isn't a bad error message; it correctly identifies new missing type parameters, but it's missing the nice JuliaSyntax highlighting, and doesn't say how many parameters were expected (not needed in this example, but for types with lots of params, it would be useful).

@MasonProtter
Copy link

I'm pretty sure this error is emitted from lowering, not from parsing so that's why it's so much less informative. Hopefully once lowering is in the julia side this can be fixed.

@nsajko nsajko added the lowering label May 9, 2024
@c42f
Copy link
Member

c42f commented Jul 26, 2024

Yep, this can't be fixed in parsing. I'd move it to JuliaLowering.jl but it seems I'll need to move that to the JuliaLang org first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants