Skip to content

Bad diagnostic for attempting to match non-tuple in array literal as tuple #65650

@hamishknight

Description

@hamishknight

This gives a bad diagnostic:

for (x, y) in [""] {} // error: tuple pattern cannot match values of non-tuple type 'Any'

We should say non-tuple type 'String', not Any.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementationfor-in loopsFeature: for-in loopspattern matchingFeature: pattern matchingpatternsFeature: patternsstatementsFeature: statementsswift 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