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

[SR-5275] Can't implement BinaryInteger without _word(at:) #47850

Open
lorentey opened this issue Jun 21, 2017 · 2 comments
Open

[SR-5275] Can't implement BinaryInteger without _word(at:) #47850

lorentey opened this issue Jun 21, 2017 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@lorentey
Copy link
Member

Previous ID SR-5275
Radar None
Original Reporter @lorentey
Type Bug
Environment

Apple Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8)

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee @moiseev
Priority Medium

md5: 81b930ef627c55646f7e09941a8595e8

Issue Description:

While updating my BigInt package for the nice new integer protocols in Swift 4, I noticed that the BinaryInteger protocol still defines _word(at:) as a required method, and provides an extension that implements words in terms of it.

This makes it impossible to implement BinaryInteger in third-party packages without touching underscored API.

The third revision of SE-0104 defines words as the required member, and removes the previous word(at:) API. The following comment in Integers.swift.gyb:1891 indicates this is a known limitation in current stdlib:

  // FIXME(integers): inefficient. Should get rid of _word(at:) and
  // countRepresentedWords, and make `words` the basic operation.
@belkadan
Copy link
Contributor

cc @moiseev

@moiseev
Copy link
Mannequin

moiseev mannequin commented Jun 21, 2017

A temporary workaround #10460

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants