Skip to content

Conversation

@tbkka
Copy link
Contributor

@tbkka tbkka commented Dec 12, 2025

These were mostly bugs with code of the following form:

  if uint64Value < (... literal expression ...)

Swift's comparison operators allow their left- and right-hand sides to be of different widths. This in turn means that the literal expression above typically gets typechecked by default as a plain Int or UInt expression. In a number of cases, this led to truncation on platforms where Int is not 64 bits.

In particular, this seems to fix tests on wasm32.

These were mostly bugs with code of the following form:
```
  if uint64Value < (... literal expression ...)
```
Swift's comparison operators allow their left- and right-hand sides to be of
different widths.  This in turn means that the literal expression above
typically gets typechecked by default as a plain `Int` or `UInt` expression.
In a number of cases, this led to truncation on platforms where `Int` is
not 64 bits.

In particular, this seems to fix tests on wasm32.
@tbkka tbkka requested a review from a team as a code owner December 12, 2025 15:21
@tbkka
Copy link
Contributor Author

tbkka commented Dec 12, 2025

@swift-ci Please test

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tbkka
Copy link
Contributor Author

tbkka commented Dec 12, 2025

This is a follow-on to #85797

expectRoundTrip(Float16.nan)
expectRoundTrip(-Float16.nan)
expectRoundTrip(Float16(nan:73, signaling:false))
#if !arch(wasm32)
Copy link
Contributor Author

@tbkka tbkka Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WASM32 doesn't seem to like signaling NaNs for Float16.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants