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

String.toInt "0x" == Ok NaN #949

Closed
zwilias opened this Issue Mar 7, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@zwilias
Member

zwilias commented Mar 7, 2018

Full list of edge-cases:

https://ellie-app.com/R9mPnktLa1/0

Current problematic

Expression 0.18 master
String.toInt "0x" Ok NaN Just NaN

Fixed on master

Expression 0.18 master
String.toInt "+" Ok NaN Nothing
String.toInt "-" Ok NaN Nothing
Edge-cases that behave correctly
Expression 0.18 master
String.toInt "0X" Err "..." Nothing
String.toInt "0o" Err "..." Nothing
String.toInt "0O" Err "..." Nothing
String.toInt "0b" Err "..." Nothing
String.toInt "0B" Err "..." Nothing
@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Mar 7, 2018

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Mar 7, 2018

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Mar 7, 2018

Member

Do you mind filling in the ??? in each case? I do not understand the headers right now, but I'll get the issue if these become Err ... and Ok NaN and Ok 0 or whatever else.

Member

evancz commented Mar 7, 2018

Do you mind filling in the ??? in each case? I do not understand the headers right now, but I'll get the issue if these become Err ... and Ok NaN and Ok 0 or whatever else.

@zwilias

This comment has been minimized.

Show comment
Hide comment
@zwilias

zwilias Mar 7, 2018

Member

Swapped thing around so the actual issue is on top, with output from 0.18 and the changes on the master branch included. Does this work better for you?

Member

zwilias commented Mar 7, 2018

Swapped thing around so the actual issue is on top, with output from 0.18 and the changes on the master branch included. Does this work better for you?

@evancz evancz added the bug label Mar 7, 2018

@evancz evancz changed the title from `String.toInt` produces `Ok NaN` to String.toInt "0x" == Ok NaN Mar 7, 2018

@rtfeldman

This comment has been minimized.

Show comment
Hide comment
@rtfeldman

rtfeldman Aug 12, 2018

Member

These all give me Nothing on 0.19; I can't reproduce any of them anymore!

Member

rtfeldman commented Aug 12, 2018

These all give me Nothing on 0.19; I can't reproduce any of them anymore!

@evancz evancz closed this Aug 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment