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
30 lines
618 B
Swift
30 lines
618 B
Swift
// RUN: %target-swift-emit-silgen %s -verify -swift-version 6
|
|
|
|
// rdar://140212823 - Make sure we build curry thunks using the adjusted
|
|
// reference type, such that the ParenExpr agrees with the type.
|
|
|
|
class C: @unchecked Sendable {
|
|
func foo() {}
|
|
}
|
|
class D: C, @unchecked Sendable {
|
|
func bar() {
|
|
let _ = (super.foo)
|
|
}
|
|
}
|
|
|
|
struct S {
|
|
func instanceMethod() {}
|
|
func foo() {
|
|
let _ = (self.instanceMethod)
|
|
}
|
|
static func staticMethod() {}
|
|
}
|
|
|
|
let _ = (S.instanceMethod)
|
|
let _ = (type(of: S()).instanceMethod)
|
|
|
|
let _ = (S.staticMethod)
|
|
let _ = (type(of: S()).staticMethod)
|
|
|
|
let _: (Int, Int) -> Int = (+)
|