Files
swift-mirror/test/Constraints/rdar140212823.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

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 = (+)