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

Req. generic masking shifts #135

Closed
oscbyspro opened this issue Jun 14, 2023 · 1 comment
Closed

Req. generic masking shifts #135

oscbyspro opened this issue Jun 14, 2023 · 1 comment
Labels
addition oh, so shiny! the fruit-signal
Milestone

Comments

@oscbyspro
Copy link
Owner

I need to overload Swift's generic masking shifts to fix an issue in the standard library's implementation for non-power-of-two bit width integers. But, that said, I want to keep the overloads to a minimum. Adding requirements to ANKFixedWidthInteger, with a custom implementation in ANKFullWidth, makes it so core integers continue to use the standard library's implementation while ANKFullWidth receives the fix. Using ANKFullWidth in the context of FixedWidthInteger will result in the standard library's behavior.

static func &<<=(lhs: inout Self, rhs: some BinaryInteger)
static func &<< (lhs: Self, rhs:  some BinaryInteger) -> Self
static func &>>=(lhs: inout Self, rhs: some BinaryInteger)
static func &>> (lhs: Self, rhs:  some BinaryInteger) -> Self
@oscbyspro oscbyspro added the addition oh, so shiny! label Jun 14, 2023
@oscbyspro oscbyspro added this to the v3.0.0 milestone Jun 14, 2023
@oscbyspro oscbyspro added the the fruit-signal label Jun 14, 2023
@oscbyspro
Copy link
Owner Author

I added protocol witness tests for ANKFixedWidthInteger in 762a850. Removing the aforementioned requirements will therefore cause some test cases to fail. If removing the requirements does not cause any test cases to fail, then  has fixed Swift's standard library implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny! the fruit-signal
Projects
None yet
Development

No branches or pull requests

1 participant