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-6606] crash on .magnitude applied to literal 0 #49156

Closed
swift-ci opened this issue Dec 13, 2017 · 1 comment
Closed

[SR-6606] crash on .magnitude applied to literal 0 #49156

swift-ci opened this issue Dec 13, 2017 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-6606
Radar None
Original Reporter ckeithray (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Xcode 9.2

command line tools 9.2 for macOS Sierra 10.12

OR

iPad Pro, iOS 11.0.3, Playgrounds 1.6.1 (674.16)

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: 8ef0c161f298e619bcd9f9777b9a1e10

duplicates:

  • SR-6602 0.magnitude fails to compile

Issue Description:

1.create a playground in Xcode OR iPad

2. run this code:

import Foundation

let i : Int = 0

print(i.magnitude) // prints "0\n"

let ui : UInt = 0

print(ui.magnitude) // prints "0\n"

let o = 0.magnitude

3. see run-time error:

error: MyPlaygroundBook.playground:6:11: error: arithmetic operation '18446744073709551615 + 1' (on unsigned 64-bit integer type) results in an overflow

let o = 0.magnitude

       ^
@belkadan
Copy link
Contributor

Steve just filed this. :-)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants