Skip to content

Legacy parser accepts invalid key path syntax #79357

@AnthonyLatsis

Description

@AnthonyLatsis

Description

An expression starting with \[ is apparently necessarily invalid and correctly rejected by the new Swift parser.

Reproduction

let _ = \[0]

Expected behavior

Parser error.

Environment

Swift 6.2-dev (d620886)

Additional information

No response

Metadata

Metadata

Assignees

Labels

accepts invalidBug: Accepts invalidbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfexpressionsFeature: expressionskey pathsFeature: key paths (both native and Objective-C)parserArea → compiler: The legacy C++ parserswift 6.2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions