Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

Improve error message for cast effect violations

  • Understand the issue and reproduce the error
  • Locate error message generation in sempass2.nim
  • Analyze how cast(raises: ...) blocks are tracked
  • Improve error message to reference the cast block
  • Test the fix
  • Run code review and security checks
Original prompt

This section details on the original issue you should resolve

<issue_title>Poor error message on cast effect violation</issue_title>
<issue_description>### Description

proc fff() {.raises: [].} =
  {.cast(raises: ValueError).}:
    echo "hello"

Nim Version

1.6.16, devel

referencing the cast would be nicer

Current Output

testit.nim(2, 18) Error: ValueError can raise an unlisted exception: ValueError

Expected Output

No response

Possible Solution

No response

Additional Information

No response</issue_description>

<agent_instructions>use ./koch temp c -r test.nim to debug this case, see whether you can improve the error messages as described</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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.

Poor error message on cast effect violation

2 participants