-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ASTGen] Implement some expressions and types #70281
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 |
BridgedTypeRepr | ||
BridgedInverseTypeRepr_createParsed(BridgedASTContext cContext, |
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.
I noticed all the current BridgedXXXTyprRepr_createParsed()
returns BridgedTypeRepr
instead of the concrete wrapper types. Since we haven't implemented checked down casting, I think it'd be better to keep the sub type as long as possible (and that's consistent with Decl/Stmt/Expr). WDYT @hamishknight ?
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.
Yeah this was just done for convenience since nothing on the ASTGen side cared about the kind of TypeRepr at the time, changing it to use the subclasses makes sense to me
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.
👍 Will do in a followup
@@ -209,7 +209,7 @@ struct TestStruct { | |||
|
|||
func test() { | |||
_ = method(arg:_:) | |||
_ = self.method(arg:_:) | |||
_ = self.method(arg:_:).self |
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.
Worth adding a test for .`self`
?
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.
Good idea 👍 Added
include/swift/AST/ASTBridging.h
Outdated
SWIFT_NAME("BridgedDictionaryExpr.createParsed(_:lBracketLoc:elements:" | ||
"colonLocs:RBracketLoc:)") |
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.
SWIFT_NAME("BridgedDictionaryExpr.createParsed(_:lBracketLoc:elements:" | |
"colonLocs:RBracketLoc:)") | |
SWIFT_NAME("BridgedDictionaryExpr.createParsed(_:lBracketLoc:elements:" | |
"colonLocs:rBracketLoc:)") |
break | ||
case // Known unimplemented kinds. | ||
.suppressedType, .packElementType, .missingType: | ||
.missingType: | ||
return false; |
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.
Are all the types migrated now? MissingTypeSyntax should only occur in invalid syntax trees AFAIK, I guess we just need some diagnostic logic for it?
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.
For valid syntax, yeah I think so. As for the diagnostics, I think the parser already emitted some. I feel like just generating ErrorTypeRepr
might be enough, but I'm not sure. Maybe we need to emit nullptr
for the entire type syntax.
AwaitExpr, BorrowExpr, ConsumeExpr, CopyExpr, TryExpr, ForceTryExpr, and OptionalTryExpr.
901b3eb
to
8f70dc3
Compare
@swift-ci Please smoke test |
Some of the tests now depend on features provided by Swift Syntax, and will fail to pass if building without Swift Syntax support. This commits marks all the tests I know fail to pass when Swift Syntax is disabled. - swiftlang#70281 modified `ASTGen/verify-parse.swift` - swiftlang#70287 created `refactoring/SyntacticRename/operator.swift` and `SourceKit/RelatedIdents/operator.swift` - swiftlang#70389 modified `SourceKit/Refactoring/basic.swift` and indirectly modified all `refactoring/ExtractFunction/*` tests.
Some of the tests now depend on features provided by Swift Syntax, and will fail to pass if building without Swift Syntax support. This commits marks all the tests I know fail to pass when Swift Syntax is disabled. - swiftlang#70281 modified `ASTGen/verify-parse.swift` - swiftlang#70287 created `refactoring/SyntacticRename/operator.swift` and `SourceKit/RelatedIdents/operator.swift` - swiftlang#70389 modified `SourceKit/Refactoring/basic.swift` and indirectly modified all `refactoring/ExtractFunction/*` tests.
Some of the tests now depend on features provided by Swift Syntax, and will fail to pass if building without Swift Syntax support. This commits marks all the tests I know fail to pass when Swift Syntax is disabled. - #70281 modified `ASTGen/verify-parse.swift` - #70287 created `refactoring/SyntacticRename/operator.swift` and `SourceKit/RelatedIdents/operator.swift` - #70389 modified `SourceKit/Refactoring/basic.swift` and indirectly modified all `refactoring/ExtractFunction/*` tests.
Some of the tests now depend on features provided by Swift Syntax, and will fail to pass if building without Swift Syntax support. This commits marks all the tests I know fail to pass when Swift Syntax is disabled. - swiftlang#70281 modified `ASTGen/verify-parse.swift` - swiftlang#70287 created `refactoring/SyntacticRename/operator.swift` and `SourceKit/RelatedIdents/operator.swift` - swiftlang#70389 modified `SourceKit/Refactoring/basic.swift` and indirectly modified all `refactoring/ExtractFunction/*` tests.
Some of the tests now depend on features provided by Swift Syntax, and will fail to pass if building without Swift Syntax support. This commits marks all the tests I know fail to pass when Swift Syntax is disabled. - swiftlang#70281 modified `ASTGen/verify-parse.swift` - swiftlang#70287 created `refactoring/SyntacticRename/operator.swift` and `SourceKit/RelatedIdents/operator.swift` - swiftlang#70389 modified `SourceKit/Refactoring/basic.swift` and indirectly modified all `refactoring/ExtractFunction/*` tests.
<expr>.self
expressiontry
,copy
,_borrow
,await
, etc.each
repeat
expression and type~
typeclass
constraint