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

Misleading location reported for "no viable alternative" #93

Open
bannmann opened this issue Dec 1, 2021 · 0 comments
Open

Misleading location reported for "no viable alternative" #93

bannmann opened this issue Dec 1, 2021 · 0 comments

Comments

@bannmann
Copy link
Contributor

bannmann commented Dec 1, 2021

Example (invalid) AG:

import java.util.List;
import java.util.function.UnaryOperator;

$ADJUSTMENTS = adjusting<F>(List<F> list, UnaryOperator<F> adjuster);

// something else

// more code

Silverchain rejects this with the following error:

Could not generate API: line 9:0 no viable alternative at input '$ADJUSTMENTS=adjusting<F>(List<F>list,UnaryOperator<F>adjuster);// something else// more code'

The location reported is misleading: it points to the end of the file, but should have been something like 4:25 (the <F>) or at least 4:16 (the adjusting<F>).

Especially for large AG files, it takes a while to figure out that it really rejects something at the start of the expression in the error message.

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

No branches or pull requests

1 participant