-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Syntax] Parse attributed types in expr position as TypeExprSyntax #34257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please smoke test |
@@ -73,6 +73,7 @@ class C <MemberDeclBlock>{<MemberDeclListItem><FunctionDecl> | |||
|
|||
func foo3<FunctionSignature><ParameterClause>() </ParameterClause></FunctionSignature><CodeBlock>{<SequenceExpr><DiscardAssignmentExpr> | |||
_ </DiscardAssignmentExpr><AssignmentExpr>= </AssignmentExpr><FunctionCallExpr><ArrayExpr>[<ArrayElement><TypeExpr><SimpleTypeIdentifier>Any</SimpleTypeIdentifier></TypeExpr></ArrayElement>]</ArrayExpr>()</FunctionCallExpr></SequenceExpr><SequenceExpr><DiscardAssignmentExpr> | |||
_ </DiscardAssignmentExpr><AssignmentExpr>= </AssignmentExpr><MemberAccessExpr><TupleExpr>(<TupleExprElement><AttributedType><Attribute>@convention(c) </Attribute><FunctionType>(<TupleTypeElement><SimpleTypeIdentifier>Int</SimpleTypeIdentifier></TupleTypeElement>) -> <SimpleTypeIdentifier>Void</SimpleTypeIdentifier></FunctionType></AttributedType></TupleExprElement>)</TupleExpr>.self</MemberAccessExpr></SequenceExpr><SequenceExpr><DiscardAssignmentExpr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to ExprNodes.py, the expression child of a TupleExprElement
must be of kind Expr
. But if I'm reading this XML correctly, would this attempt to put an AttributedType
directly into the TupleExprElement
, which wouldn't "fit" because an AttributedType
isn't an Expr
?
What would this look like when SwiftSyntax tries to parse it into the gybbed data types; i.e., how would I access the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, the test result file is outdated (I forgot to git add
I believe). Will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
e8256ae
to
4117512
Compare
@swift-ci Please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix!
rdar://problem/70101520
https://bugs.swift.org/browse/SR-13711