mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix a trio of issues involving mangling for opaque result types: * Symbolic references to opaque type descriptors are not substitutions * Mangle protocol extension contexts correctly * Mangle generic arguments for opaque result types of generic functions The (de-)serialization of generic parameter lists for opaque type declarations is important for the last bullet, to ensure that the mangling of generic arguments of opaque result types works across module boundaries. Fixes the rest of rdar://problem/50038754.
28 lines
381 B
Swift
28 lines
381 B
Swift
public protocol Foo {}
|
|
|
|
public struct FooImpl: Foo {
|
|
public init() {}
|
|
}
|
|
|
|
public func anyFoo() -> some Foo {
|
|
return FooImpl()
|
|
}
|
|
|
|
public var anyFooProp: some Foo {
|
|
return FooImpl()
|
|
}
|
|
|
|
public struct Subscript {
|
|
public init() {}
|
|
|
|
public subscript() -> some Foo {
|
|
return FooImpl()
|
|
}
|
|
}
|
|
|
|
extension Foo {
|
|
public func identity<T>(_: T) -> some Foo {
|
|
return self
|
|
}
|
|
}
|