just icon indicating copy to clipboard operation
just copied to clipboard

Bug in redefinition compile error reporting

Open marcaddeo opened this issue 1 year ago • 1 comments

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?

marcaddeo avatar Sep 06 '24 23:09 marcaddeo

Thanks for the report!

Should I pull the relevant code changes from https://github.com/casey/just/pull/2344 and put a new PR in addressing the bug?

Yes, that would be awesome!

casey avatar Sep 07 '24 01:09 casey