Files
swift-mirror/test/Serialization/Inputs/OpaqueCrossFileB.swift
Doug Gregor e29469b9c0 [Opaque result types] Fix mangling issues with opaque result types.
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.
2019-04-22 17:10:45 -07:00

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
}
}