mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Currently we set `FunctionRefKind::Compound` for enum element patterns with tuple sub-patterns to ensure the member has argument labels stripped. As such, we need to account for the correct application level in `getNumApplications`. We ought to be setting the correct FunctionRefKind and properly handling the label matching in the solver though. We also ought to consider changing FunctionRefKind such that "is compound" is a separate bit from the application level. rdar://139234188
26 lines
602 B
Swift
26 lines
602 B
Swift
// RUN: %target-swift-emit-silgen %s -verify -swift-version 6
|
|
|
|
struct S: Equatable {
|
|
static func foo() -> Self { fatalError() }
|
|
static func bar(_ x: Int) -> Self { fatalError() }
|
|
static func baz(x: Int, y: Int) -> Self { fatalError() }
|
|
public static func == (_: Self, _: Self) -> Bool { false }
|
|
}
|
|
|
|
// rdar://139234188 - Make sure we don't consider these members to be partially
|
|
// applied for concurrency adjustment.
|
|
func foo(_ x: S) {
|
|
_ = {
|
|
switch x {
|
|
case .foo():
|
|
break
|
|
case .bar(0):
|
|
break
|
|
case .baz(x: 1, y: 2):
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
}
|