Skip to content

Fix dropping of error locations#37

Open
cchalmers wants to merge 2 commits into
masterfrom
fix-error-locations
Open

Fix dropping of error locations#37
cchalmers wants to merge 2 commits into
masterfrom
fix-error-locations

Conversation

@cchalmers

Copy link
Copy Markdown
Owner

Since #14 the error locations often pointed to the end of the circuit instead of the correct location. That should now be fixed, along with a regression test.

Hopefully resolves #35.

Since #14 the error locations often pointed to the end of the circuit instead of the correct location. That should now be fixed, along with a regression test.
@martijnbastiaan

Copy link
Copy Markdown
Collaborator

Cool! I did find an issue in the meantime, but I have yet to make a minimal reproducer out of it. I'll have a look.

Perhaps for testing you can use this structure:

https://github.com/clash-lang/checked-literals/blob/568a8603491bca0dbb24586828edf3040f30ee6f/tests/Test/Tasty/AssertGhc.hs

and

https://github.com/clash-lang/checked-literals/blob/568a8603491bca0dbb24586828edf3040f30ee6f/flake.nix#L42-L51

That way it doesn't just run in Nix.

The error-location test shells out to ghc to compile a fixture with the
plugin enabled. During the package's own nix check phase circuit-notation
isn't registered in any package database, so that compile cannot succeed and
the test would fail the build. Probe ghc first and skip (rather than fail)
when it can't compile against the plugin; the test still runs for real under
cabal test, where the package environment file makes the plugin available.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cchalmers cchalmers force-pushed the fix-error-locations branch from b6fd712 to f83ef95 Compare June 23, 2026 09:21
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

Successfully merging this pull request may close these issues.

Track confusing error messages

2 participants