Skip to content
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

[SR-11687] Swift 5.1.1 Linux Scanner.scanDouble returns Optional(0.0) instead of nil on failure #3378

Closed
swift-ci opened this issue Oct 31, 2019 · 3 comments
Assignees

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-11687
Radar None
Original Reporter andreasw (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Ubuntu Linux 19.10
Swift 5.1.1 from swift.org

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @spevans
Priority Medium

md5: 0b02550c3fd4ef2ca8f58a5b22550c8a

Issue Description:

On Linux, the following code outputs

0.5
Optional(0.0)

where I expected (and get on macOS):

0.5
ok
nil

================================================

import Foundation
let scanner = Scanner(string: "0.5 bla")
var value = scanner.scanDouble()
print(value!)
value = scanner.scanDouble()
if value == nil {
print("ok")
}
print(value as Any)

================================================

@spevans
Copy link
Collaborator

spevans commented Nov 5, 2019

#2552

@swift-ci
Copy link
Contributor Author

swift-ci commented Nov 5, 2019

Comment by Andreas Wendleder (JIRA)

LGTM, thanks. I'm waiting for a snapshot to test.

@swift-ci
Copy link
Contributor Author

Comment by Andreas Wendleder (JIRA)

Tested with snapshot from 2019-11-11 on Ubuntu.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants