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

Bug in redefinition compile error reporting #2350

Open
marcaddeo opened this issue Sep 6, 2024 · 1 comment
Open

Bug in redefinition compile error reporting #2350

marcaddeo opened this issue Sep 6, 2024 · 1 comment

Comments

@marcaddeo
Copy link
Contributor

While working on #2344 I noticed that the error reporting for redefinition compile errors was not properly swapping types in the messaging when the redefinition is between two types.

Examples:

Aliases

foo:
  echo foo

alias foo := bar

bar:
  echo bar
error: Alias `foo` defined on line 1 is redefined as a recipe on line 4
 ——▶ just-test:4:7
  │
4 │ alias foo := bar
  │       ^^^

Modules

foo:
  echo foo

mod foo "foo.just"
error: Module `foo` defined on line 1 is redefined as a recipe on line 4
 ——▶ just-test:4:5
  │
4 │ mod foo "foo.just"
  │     ^^^

Should I pull the relevant code changes from #2344 and put a new PR in addressing the bug?

@casey
Copy link
Owner

casey commented Sep 7, 2024

Thanks for the report!

Should I pull the relevant code changes from #2344 and put a new PR in addressing the bug?

Yes, that would be awesome!

marcaddeo added a commit to marcaddeo/just that referenced this issue Sep 7, 2024
The original and redefined Name's were being properly swapped, but their
types weren't being swapped. This caused the error to report on the
wrong lines when the redefinition was between two different types, i.e.
alias and recipe.

Closes casey#2350
marcaddeo added a commit to marcaddeo/just that referenced this issue Sep 7, 2024
The original and redefined Name's were being properly swapped, but their
types weren't being swapped. This caused the error to report on the
wrong lines when the redefinition was between two different types, i.e.
alias and recipe.

Closes casey#2350
marcaddeo added a commit to marcaddeo/just that referenced this issue Sep 10, 2024
The original and redefined Name's were being properly swapped, but their
types weren't being swapped. This caused the error to report on the
wrong lines when the redefinition was between two different types, i.e.
alias and recipe.

Closes casey#2350
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

2 participants