Files
swift-mirror/test/IRGen/serialised-pwt-afp.swift
Saleem Abdulrasool 0301e03cc3 TDBGen: add a workaround for a workaround for async PWT
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!
2023-04-06 09:01:55 -07:00

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