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

No extra quotientAndRemainder(dividingBy:) default #19

Open
oscbyspro opened this issue Jun 21, 2023 · 1 comment
Open

No extra quotientAndRemainder(dividingBy:) default #19

oscbyspro opened this issue Jun 21, 2023 · 1 comment
Labels
help please send help :(

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Jun 21, 2023

I provide three quotientAndRemainder(dividingBy:) defaults in NBKBinaryInteger.swift, which is one more than you'd expect. That's because the core integers do not compile without the where Self == Digit version. I think its an inelegant solution, but I'm not quite sure how to resolve it. If you've got any ideas, let me know.

func quotientAndRemainder(dividingBy other: Self) -> QR<Self, Self> { ... }
func quotientAndRemainder(dividingBy other: Self) -> QR<Self, Self> where  Self ==  Digit  { ... }
@_disfavoredOverload func quotientAndRemainder(dividingBy other: Digit) -> QR<Self, Digit> { ... }
@oscbyspro oscbyspro added the help please send help :( label Jun 21, 2023
@oscbyspro
Copy link
Owner Author

oscbyspro commented Jun 29, 2023

I believe this would not be an issue if it were possible to constrain the default digit methods to a scope where Self != Self.Digit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help please send help :(
Projects
None yet
Development

No branches or pull requests

1 participant