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-11084] Example LazyScanIterator, LazyScanSequence code in LazySequence doesn't compile #53476

Closed
haikusw opened this issue Jul 8, 2019 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. documentation standard library Area: Standard library umbrella

Comments

@haikusw
Copy link
Contributor

haikusw commented Jul 8, 2019

Previous ID SR-11084
Radar None
Original Reporter @haikusw
Type Bug
Status Closed
Resolution Done
Environment

macOS X 10.14.5, Xcode 10.2.1 and Xcode 11.0 beta 2 (11M337n), and Xcode 11.0 beta 3 (11M362v)

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, Documentation
Assignee None
Priority Medium

md5: 3b098d0a30040d1b877382878d38e8a1

Issue Description:

The documentation for `LazySequenceProtocol` Overview section includes some sample code for building "a sequence that lazily computes the elements in the result of scan". As written, this example code does not compile under Swift 5.0 or 5.1. This documentation comes from comments in stdlib/public/core/LazySequence.swift .

In particular, the `LazyScanIterator` construction in `LazyScanSequence::makeIterator()` gets the following compiler errors:

  • "LazyScanIterator<Base, ResultElement>' initializer is inaccessible due to 'private' protection level"

  • "Missing argument label 'nextPartialResult:' in call"

Similarly for the `LazyScanSequence` construction in `LazySequenceProtocol::scan(…)`:

  • "Cannot invoke initializer for type 'LazyScanSequence<_, _>' with an argument list of type '(initial: ResultElement, base: Self, (ResultElement, Self.Element) -> ResultElement)'"

Since readers of the documentation are likely to want to copy and paste this code and try it out, or copy it when making their own `LazySequenceProtocol` conforming struct, this code should compile and run properly.

A PR fixing the problems has been provided: #25995

@haikusw
Copy link
Contributor Author

haikusw commented Jul 8, 2019

Priority is defaulting to "Medium" but seems more like "Low". I don't seem to have access sufficient to reduce the priority; perhaps someone who does could do so. TIA

@belkadan
Copy link
Contributor

belkadan commented Jul 8, 2019

We don't use the Priority field at all but if I recall correctly Jira won't let us remove it entirely.

@haikusw
Copy link
Contributor Author

haikusw commented Jul 8, 2019

Ok. Thanks.

@haikusw
Copy link
Contributor Author

haikusw commented Jul 19, 2019

#25995 was merged and resolves this issue.

@haikusw
Copy link
Contributor Author

haikusw commented Jul 19, 2019

749a972 was merged

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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. documentation standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants