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

[Feature] Compiler should be able to emit multiple errors #667

Open
b1ek opened this issue Jan 18, 2025 · 1 comment
Open

[Feature] Compiler should be able to emit multiple errors #667

b1ek opened this issue Jan 18, 2025 · 1 comment
Labels
compiler enhancement New feature or request syntax

Comments

@b1ek
Copy link
Member

b1ek commented Jan 18, 2025

Is your feature request related to a problem? Please describe.
If there is more than one error in the code, the compiler will always emit only one:

for this code:

fun say_hi(name: Text) {
    echo "hi " + name
}

say_hi("li hua")
say_hi(123)
say_hi(123)

compiler errors out with:

 ERROR  1st argument 'name' of function 'say_hi' expects type 'Text', but 'Num' was given
at test.ab:5:1

4| say_hi("li hua")
5| say_hi(123)
6| say_hi(123)

Describe the solution you'd like
something like this:

 ERROR  1st argument 'name' of function 'say_hi' expects type 'Text', but 'Num' was given
at test.ab:5:1

4| say_hi("li hua")
5| say_hi(123)
6| say_hi(123)

 ERROR  1st argument 'name' of function 'say_hi' expects type 'Text', but 'Num' was given
at test.ab:6:1

5| say_hi(123)
6| say_hi(123)

Describe alternatives you've considered
leave it as is because it might not be worth the major restructuring efforts

@b1ek
Copy link
Member Author

b1ek commented Jan 18, 2025

it will not be possible to combine parser & compiler errors, though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler enhancement New feature or request syntax
Projects
None yet
Development

No branches or pull requests

1 participant