Files
swift-mirror/test/Constraints/rdar139234188.swift
Hamish Knight 746135b4d7 [CS] Add a narrow hack for rdar://139234188
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
2024-11-22 13:43:58 +00:00

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
}
}
}