Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support universal equality of unsigned numeric types#3584

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@WojciechMazur
Copy link
Contributor

This change allows to use universal equality for combination of signed and unsigned numeric types. It means we can run comparisons like2 + 2 == 4.toUInt, or-1.toUByte == 255.
To allow for that when used in erased context, we modify the NIR generated for== and!= primitives. These now would delegate toscala.runtime.BoxesRunTime.equals instead of delegating to customObject.__scala_== which now becomes obsolete and removed.

All numeric equality comparsions are now available between any ofByte,Short,Int,Long,UByte,UShort,UInt,UByte,Size,USize andChar.

lolgab reacted with rocket emoji
Copy link
Member

@ekrichekrich left a comment

Choose a reason for hiding this comment

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

Wow, this is a great change.

@WojciechMazurWojciechMazur merged commita79fb09 intoscala-native:mainOct 29, 2023
@WojciechMazurWojciechMazur deleted the unsiged/universal-equality branchOctober 29, 2023 21:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@ekrichekrichekrich requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@WojciechMazur@ekrich

[8]ページ先頭

©2009-2025 Movatter.jp