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

Unsigned is Magnitude req. #91

Closed
oscbyspro opened this issue Apr 25, 2023 · 1 comment
Closed

Unsigned is Magnitude req. #91

oscbyspro opened this issue Apr 25, 2023 · 1 comment
Labels
addition oh, so shiny!

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Apr 25, 2023

Many things would be simpler if all unsigned integers had this requirement:

where Magnitude == Self

But I get the following ever-so-unhelpful error in ANKFullWidthKit when I add it:

🔴 Command SwiftCompile failed with a nonzero exit code
@oscbyspro oscbyspro added brrr such code, much wow help please send help :( labels Apr 25, 2023
@oscbyspro
Copy link
Owner Author

oscbyspro commented Apr 25, 2023

I can get it to compile by adding where High.Magnitude == High to each unsigned conditional conformance:

extension ANKFullWidth: UnsignedInteger              where High: UnsignedInteger,              High == High.Magnitude { }
extension ANKFullWidth: ANKUnsignedInteger           where High: ANKUnsignedInteger,           High == High.Magnitude { }
extension ANKFullWidth: ANKUnsignedFixedWidthInteger where High: ANKUnsignedFixedWidthInteger, High == High.Magnitude { }

Edit: the same type clause is only required for UnsignedInteger. I think the compiler needs a vacation.

@oscbyspro oscbyspro removed the help please send help :( label Apr 25, 2023
@oscbyspro oscbyspro added this to the v2.0.0 milestone Apr 25, 2023
oscbyspro added a commit that referenced this issue Apr 25, 2023
oscbyspro added a commit that referenced this issue Apr 25, 2023
@oscbyspro oscbyspro added addition oh, so shiny! and removed brrr such code, much wow labels Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny!
Projects
None yet
Development

No branches or pull requests

1 participant