Skip to content

Conversation

@nickolas-pohilets
Copy link
Contributor

This MR adds missing functionality to generate code for KeyConversion and ValueConversion in CollectionUpcastConversionExpr. New built-ins have been added to the standard library as @_alwaysEmitIntoClient for backwards compatibility.

@nickolas-pohilets nickolas-pohilets marked this pull request as draft October 9, 2025 13:06
Comment on lines +1672 to +1675
namespace {
class ConversionClosureEmitter: public Lowering::ExprVisitor<ConversionClosureEmitter, Expr*> {
ASTContext &Context;
OpaqueValueExpr *OrigValue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AST transformations and non-trivial expression synthesis should happen in Sema, not SILGen. One of the main reasons why is that SILGen happens after the ASTVerifier has run.

One way to do this is to define an ASTWalker and have it run during TypeCheckPrimaryFileRequest::evaluate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants