Skip to content

Fix: Check for u32 first so positive numbers don't get trapped by i32#38

Draft
StephenJarso wants to merge 1 commit into
rezzcode:mainfrom
StephenJarso:fixes
Draft

Fix: Check for u32 first so positive numbers don't get trapped by i32#38
StephenJarso wants to merge 1 commit into
rezzcode:mainfrom
StephenJarso:fixes

Conversation

@StephenJarso

Copy link
Copy Markdown

check if the type is unsigned integer before checking for signed integer as positive number which is unsigned never gets return as of type unsigned and we are checking the i32 condition making the u32 condition never to be reached

@the1Riddle the1Riddle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but there is something you might have missed.

@the1Riddle

Copy link
Copy Markdown
Collaborator

hello @StephenJarso

Thanks for opening this pull request. It's actually true that on a statement, if i32 comes before u32 then
The unsigned int would be unreachable. Although the fix makes perfect sense, you would realize that
if an expected failure passes, then that's a bug.

By this, I mean that this code was written intentionally to fail, so a contributor could fix it in their code update. Therefore, if you make it pass, then...?

so where should you submit this update? Fortunately, there is a solution directory located at the root of this repository where you can create a fix and submit it. Additionally, you can help align how code fixes are displayed in the solutions, or you can simply add your update to the solutions/snippets/ directory.

tip: you will notice that there is more to the code snippets than just the u32 and i32 being unreachable.

thanks.

@rezzcode rezzcode added good first issue Good for newcomers invalid This doesn't seem right Code labels Jun 4, 2026
@the1Riddle the1Riddle marked this pull request as draft June 14, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code good first issue Good for newcomers invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants