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-15653] Comparing literal to Int.max gives incorrect result #57932

Open
idrougge opened this issue Dec 23, 2021 · 0 comments
Open

[SR-15653] Comparing literal to Int.max gives incorrect result #57932

idrougge opened this issue Dec 23, 2021 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@idrougge
Copy link

Previous ID SR-15653
Radar None
Original Reporter @idrougge
Type Bug
Environment

Swift 5.5.2-dev, also tested on swift-5.0-RELEASE with same result.

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

md5: 1030ac2f0248747bd08c93e2e1a028eb

Issue Description:

In Swift 5.5.2, the following line gives an overflow error:

128 < Int8.max

Meanwhile, the following line return false, even though 128 is larger than Int8.max

128 > Int8.max

The same happens with any Int type.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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.
Projects
None yet
Development

No branches or pull requests

1 participant