Skip to content

Bad diagnostic when matching tuple pattern to existential #65243

Open
@AnthonyLatsis

Description

@AnthonyLatsis

Steps to reproduce

func foo(_ a: Any) {
  if case (0, 0) = a {} // error: type of expression is ambiguous without more context
}

Test case from #63992 (comment).

Environment

  • Swift version 5.9-dev (LLVM 91080e65df791d6, Swift c1d5118)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationexistentialsFeature: values of types like `any Collection`, `Any` and `AnyObject`; type-erased valuespattern matchingFeature: pattern matchingpatternsFeature: patternsswift 5.9tuplesFeature: tuplestype checkerArea → compiler: Semantic analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions