-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Compile Time Constant Extraction] Support for open existential expressions #83008
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
base: main
Are you sure you want to change the base?
[Compile Time Constant Extraction] Support for open existential expressions #83008
Conversation
lib/ConstExtract/ConstExtract.cpp
Outdated
@@ -355,6 +355,19 @@ extractCompileTimeValue(Expr *expr, const DeclContext *declContext) { | |||
} | |||
} | |||
|
|||
if (functionKind == ExprKind::FunctionConversion) { |
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.
Please refactor the various places in this function that do:
if (functionKind == ExprKind::DotSyntaxCall) {
auto dotSyntaxCallExpr = cast<DotSyntaxCallExpr>(callExpr->getFn());
To instead do
if (auto dotSyntaxCallExpr = dyn_cast<DotSyntaxCallExpr>(callExpr->getFn()) {
lib/ConstExtract/ConstExtract.cpp
Outdated
if (functionKind == ExprKind::FunctionConversion) { | ||
auto functionConversionExpr = cast<FunctionConversionExpr>(callExpr->getFn()); | ||
if (functionConversionExpr->getSubExpr()->getKind() == ExprKind::DeclRef) { | ||
auto declRefExpr = cast<DeclRefExpr>(functionConversionExpr->getSubExpr()); |
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.
Same here
@swift-ci 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.
Much cleaner, thank you :)
@swift-ci please test macOS platform |
Adding support for extracting open existential expressions that may impact extraction for Swift 6
Resolves rdar://155634076