Skip to content

fixes #22475; improve undeclared identifier errors with import chain - #25991

Open
nimamasl114514 wants to merge 3 commits into
nim-lang:develfrom
nimamasl114514:fix-22475
Open

fixes #22475; improve undeclared identifier errors with import chain#25991
nimamasl114514 wants to merge 3 commits into
nim-lang:develfrom
nimamasl114514:fix-22475

Conversation

@nimamasl114514

Copy link
Copy Markdown
Contributor

Fixes #22475

When an undeclared identifier error occurs in an imported module, the error message now shows the import chain to help users understand where the error originated.

Before:
lib/pure/endians.nim(131, 57) Error: undeclared identifier: 'copyMem'

After:
lib/pure/endians.nim(131, 57) Error: undeclared identifier: 'copyMem' imported from test.nim which imports oids.nim at endians.nim(131, 56)

This helps users identify that the error comes from std/oids -> endians.nim chain when using JS backend.

…t chain

When an undeclared identifier error occurs in an imported module, show the import chain to help users understand where the error originated. Example: 'imported from main.nim which imports std/oids at endians.nim(line, col)'.
When a forbids pragma violation occurs, the error message now shows the call chain to help identify where the forbidden effect originated. Example: 'Error: c() has an illegal effect: NestedPoll call chain: from test.nim(12, 2) from test.nim(9, 13)'.
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.

Ambiguous error when importing lib std/oids with js backend

1 participant