mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This matches the double curry thunk logic and ensures that the resulting autoclosure matches the expected type of the reference, avoiding mismatches with parent expressions. rdar://140212823
18 lines
515 B
Swift
18 lines
515 B
Swift
// RUN: %target-swift-emit-silgen -verify -disable-objc-attr-requires-foundation-module %s
|
|
// RUN: %target-swift-emit-silgen -verify -swift-version 6 -disable-objc-attr-requires-foundation-module %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
@objc class C {
|
|
@preconcurrency @objc func foo(_ x: Sendable) {}
|
|
}
|
|
|
|
func bar(_ fn: (Any) -> Void) {}
|
|
func bar(_ fn: (Sendable) -> Void) {}
|
|
|
|
// Make sure we can handle both the implicit unwrap and concurrency adjustment.
|
|
func foo(_ x: AnyObject) {
|
|
bar(x.foo)
|
|
let _ = AnyObject.foo
|
|
}
|