Files
swift-mirror/test/Concurrency/preconcurrency_anyobject_lookup.swift
Hamish Knight 68648f74ef [CS] Use adjusted type for single curry thunks
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
2024-11-21 12:14:00 +00:00

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
}