You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-15467 Confusing error message for unavailable member when conforming to protocol
Issue Description:
When creating a type that conforms to Collection, create implementations for all requirements except for `subscript(bounds: Range<Index>) -> Subsequence`. This will cause the compiler to try to satisfy this requirement with an unavailable subscript, which will raise the following error:
If the type also declares that it conforms to refined types such as BidirectionalCollection, RandomAccessCollection, and RangeReplaceableCollection, the error message and the notes will be duplicated once for every additional protocol:
This may cause the user to incorrectly assume that there is more than one problem in the code, and makes it harder to understand that the real problem is in the conformance to Collection (as opposed to the other protocols).
The attached test.swift file causes these errors in Swift 5.5.1.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
MacOS 12.0.1 - Swift 5.5.1
Additional Detail from JIRA
md5: 97d7a14edb4c17bb51d50a8b40a74503
relates to:
Issue Description:
When creating a type that conforms to Collection, create implementations for all requirements except for `subscript(bounds: Range<Index>) -> Subsequence`. This will cause the compiler to try to satisfy this requirement with an unavailable subscript, which will raise the following error:
If the type also declares that it conforms to refined types such as BidirectionalCollection, RandomAccessCollection, and RangeReplaceableCollection, the error message and the notes will be duplicated once for every additional protocol:
This may cause the user to incorrectly assume that there is more than one problem in the code, and makes it harder to understand that the real problem is in the conformance to Collection (as opposed to the other protocols).
The attached test.swift file causes these errors in Swift 5.5.1.
The text was updated successfully, but these errors were encountered: