-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
accepts invalidBug: Accepts invalidBug: Accepts invalidbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfexpressionsFeature: expressionsFeature: expressionsfunction referencesFeature: function references as in 'foo(bar:baz:)'Feature: function references as in 'foo(bar:baz:)'swift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Currently we set FunctionRefKind::Compound
for EnumElementPatterns to avoid needing to match labels in the solver. We instead ought to be setting the right kind and properly handling the label matching in the solver.
While here it also looks like the compound naming needs fixing too, e.g we currently allow this:
struct S: Equatable {
static func bar(x: Int) -> Self { fatalError() }
public static func == (_: Self, _: Self) -> Bool { false }
}
func foo(_ x: S) {
_ = {
switch x {
case .bar(x:)(x: 0):
break
default:
break
}
}
}
rdar://140415944
Metadata
Metadata
Assignees
Labels
accepts invalidBug: Accepts invalidBug: Accepts invalidbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfexpressionsFeature: expressionsFeature: expressionsfunction referencesFeature: function references as in 'foo(bar:baz:)'Feature: function references as in 'foo(bar:baz:)'swift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis