Certain IdentifierPattern
s in the old parser now parsed as IdentifierExpr
#831
Labels
IdentifierPattern
s in the old parser now parsed as IdentifierExpr
#831
Issue Kind
Parse of Valid Source Produced Invalid Syntax Tree
Source Code
Description
This code snippet produces the following parse tree:
For
z
, the C++ parser instead produced anUnresolvedPatternExprSyntax
with anIdentifierPatternSyntax
as its child.The C++ tree distinguishes identifiers that are bound in the pattern from those which aren't or can't be. For example,
let .y(z, someFunction(5))
,z
would be anIdentifierPattern
whilesomeFunction
would be anIdentifierExpr
s.let .y(z, someFunction(w))
,z
andw
would beIdentifierPattern
s whilesomeFunction
would be anIdentifierExpr
(and the compiler would later emit an error thatpattern variable binding cannot appear in an expression
).The text was updated successfully, but these errors were encountered: