mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Centralize and simplify the handling of conformance requirements resolved by same-type-to-concrete requirements in a few ways: * Always store a ProtocolConformanceRef in via-superclass and via-concrete requirement sources, so we never lose this information. * When concretizing a nested type based on its parent, use the via-concrete conformance information rather than performing lookup again, simplifying this operation considerably and avoiding redundant lookups. * When adding a conformance requirement to a potential archetype that is equivalent to a concrete type, attempt to find and record the conformance. Fixes SR-4295 / rdar://problem/31372308.
22 lines
540 B
Swift
22 lines
540 B
Swift
// RUN: not %target-swift-frontend -emit-ir -primary-file %s
|
|
|
|
// REQUIRES: asserts
|
|
|
|
internal protocol _UTFEncoding {
|
|
associatedtype EncodedScalar where EncodedScalar == Int
|
|
}
|
|
|
|
public protocol _UnicodeEncoding {
|
|
associatedtype EncodedScalar : BidirectionalCollection
|
|
}
|
|
|
|
public protocol _UnicodeEncoding_ {
|
|
associatedtype ForwardParser: _UnicodeEncoding
|
|
}
|
|
|
|
public protocol UnicodeEncoding: _UnicodeEncoding_ where ForwardParser == Self {}
|
|
|
|
public protocol _UTFParser {
|
|
associatedtype Encoding: UnicodeEncoding, _UTFEncoding
|
|
}
|