mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
20 lines
517 B
Swift
20 lines
517 B
Swift
// RUN: not %target-swift-frontend -typecheck %s
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
protocol AttributedStringKey {
|
|
associatedtype Value : Hashable
|
|
}
|
|
|
|
protocol AttributedStringProtocol {
|
|
subscript<K>(_: K.Type) -> K.Value? where K : AttributedStringKey { get set }
|
|
subscript<R>(bounds: R) -> AttributedSubstring where R : RangeExpression, R.Bound == AttributedString.Index { get }
|
|
}
|
|
|
|
public struct AttributedSubstring : Sendable {
|
|
}
|
|
|
|
extension AttributedSubstring : AttributedStringProtocol {
|
|
}
|