You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swift 5.5 (Xcode 13b2), or parser library built from main on 7/14
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: 26a3a45b0f82837a01776b29f02785f7
Issue Description:
When implementing PostfixIfConfigExprSyntax support for swift-format, I found that nested #if expressions are being returned as UnknownExprSyntax nodes rather than PostfixIfConfigExprSyntax. For example, in this snippet:
receiver
{{ #if ONE}}
{{ #if TWO}}
{{ .call()}}
The outer postfix expression (#if ONE) is PostfixIfConfigExprSyntax, but the inner one (#if TWO) is an UnknownExprSyntax. The inner node's children still appear to be correctly parsed as IfConfigDeclSyntax, however, at least in this simple case; only the expression's node itself was incorrect.
The above code snippet repro's with the syntax parser library built from main (as of 7/14) and also with the Xcode 13b2 compiler using -Xfrontend -emit-syntax:
parse.swift:3:9: error: unknown expression syntax exists in the source
{{ #if TWO}}
{{ ^}}
The text was updated successfully, but these errors were encountered:
Environment
Swift 5.5 (Xcode 13b2), or parser library built from main on 7/14
Additional Detail from JIRA
md5: 26a3a45b0f82837a01776b29f02785f7
Issue Description:
When implementing
PostfixIfConfigExprSyntax
support for swift-format, I found that nested#if
expressions are being returned asUnknownExprSyntax
nodes rather thanPostfixIfConfigExprSyntax
. For example, in this snippet:receiver
{{ #if ONE}}
{{ #if TWO}}
{{ .call()}}
The outer postfix expression (
#if ONE
) isPostfixIfConfigExprSyntax
, but the inner one (#if TWO
) is anUnknownExprSyntax
. The inner node's children still appear to be correctly parsed asIfConfigDeclSyntax
, however, at least in this simple case; only the expression's node itself was incorrect.The above code snippet repro's with the syntax parser library built from main (as of 7/14) and also with the Xcode 13b2 compiler using
-Xfrontend -emit-syntax
:parse.swift:3:9: error: unknown expression syntax exists in the source
{{ #if TWO}}
{{ ^}}
The text was updated successfully, but these errors were encountered: