Fix: Check for u32 first so positive numbers don't get trapped by i32#38
Fix: Check for u32 first so positive numbers don't get trapped by i32#38StephenJarso wants to merge 1 commit into
Conversation
the1Riddle
left a comment
There was a problem hiding this comment.
This looks good, but there is something you might have missed.
|
hello @StephenJarso Thanks for opening this pull request. It's actually true that on a statement, if i32 comes before u32 then 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. |
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