We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
md5: 814da93b5b8c456ddd7f8b62a26aac10
Issue Description:
Start with:
public enum InvertedRange<Index: Comparable> { case beforeStart, afterEnd, all case prefix(upThrough: Index) case range(after: Index, upThrough: Index) case suffix(after: Index) } public protocol TransferableCollection: MutableCollection /*[[1]]*/ where /*[[2]]*/ Self.SubSequence: TransferableCollection {} extension TransferableCollection /*[[3]]*/ { private func convertRange(_ range: InvertedRange<Index>) -> Range<Index> { /*...*/ } private func convertRange<R>(_ range: R) -> InvertedRange<Index> where R: RangeExpression, R.Bound == Index { let r = range.relative(to: self) switch (r.lowerBound, r.upperBound) { case (startIndex, endIndex): return .all case (startIndex, startIndex): return .beforeStart case (startIndex, let i): return .prefix(upThrough: index(before: i)) // ERROR HERE case (let i, endIndex): return .suffix(after: index(before: i)) // AND HERE case (endIndex, endIndex): return .afterEnd case (let s, let e): return .range(after: index(before: s), upThrough: index(before: e)) // AND HERE } } }
Where there are three errors at the lines that call the base BidirectionalCollection method, index(before: ). The error is:
BidirectionalCollection
index(before: )
Argument labels '(before:)' do not match any available overloads
This can be remedied by replacing comment-spot #3 with:
where Self: BidirectionalCollection
But I should be able to do that in the primary definition. If I put comment-spot #3 back into a comment and replace comment-spot #2 with:
Self: BidirectionalCollection,
it should also correct the problem, but it doesn't. Worse, putting the declaration in comment-spot #3 again this time does not fix it!
However, if I turn comment-spots #2 and #3 back into comments, and replace comment-spot #1 with:
, BidirectionalCollection
Then the code in the extension block works. (Putting the where-clause back in comment-spot #3 doesn't change anything this time.)
where
The text was updated successfully, but these errors were encountered:
cc @huonw
Sorry, something went wrong.
No branches or pull requests
Additional Detail from JIRA
md5: 814da93b5b8c456ddd7f8b62a26aac10
Issue Description:
Start with:
Where there are three errors at the lines that call the base
BidirectionalCollection
method,index(before: )
. The error is:This can be remedied by replacing comment-spot #3 with:
But I should be able to do that in the primary definition. If I put comment-spot #3 back into a comment and replace comment-spot #2 with:
it should also correct the problem, but it doesn't. Worse, putting the declaration in comment-spot #3 again this time does not fix it!
However, if I turn comment-spots #2 and #3 back into comments, and replace comment-spot #1 with:
, BidirectionalCollection
Then the code in the extension block works. (Putting the
where
-clause back in comment-spot #3 doesn't change anything this time.)The text was updated successfully, but these errors were encountered: