Skip to content

Fix for pure/random.nim / sample triggering ProveInit #24982

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

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

heysokam
Copy link

@heysokam heysokam commented Jun 8, 2025

Simple fix for sample*[T](r: var Rand; s: set[T]): T triggering ProveInit

.nim/lib/pure/random.nim(425, 3) Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]

.nim/lib/pure/random.nim(425, 3) Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]
@laylie527
Copy link
Contributor

laylie527 commented Jun 24, 2025

Is it not better to instead put the default value / a raiseAssert at the bottom, since it's supposed to be unreachable?

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.

2 participants