mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When a protocol witness thunk is formed to a serialised protocol containing an `async` function, the async function pointer to the conformance needs to be made public due to a SIL Verifier check failure (reference to a non-fragile function from within a public fragile function). Add a stop-gap solution of rolling an extra emission for a private symbol as a public symbol to avoid the error (the underlying issue has been open for ~6y and counting as of this commit). This was identified by swift-package-manager (#64900). Thanks to @DougGregor and @aschwaighofer for the discussion on this!
24 lines
533 B
Swift
24 lines
533 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -disable-availability-checking -emit-module -emit-module-path %t/P.swiftmodule -parse-as-library -module-name P -DP %s
|
|
// RUN: %target-swift-frontend -disable-availability-checking -I%t -parse-as-library -module-name Q -c %s -o /dev/null -validate-tbd-against-ir=missing
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
#if P
|
|
public protocol P {
|
|
func f() async
|
|
}
|
|
#else
|
|
import P
|
|
|
|
protocol Q: P { }
|
|
|
|
extension Q {
|
|
public func f() async { }
|
|
}
|
|
|
|
public struct S: Q {
|
|
public init() { }
|
|
}
|
|
#endif
|