Skip to content

Commit 3f3df33

Browse files
committed
[Macros] Ensure that we compute the interface type before we add accessors
Adding accessors to a stored property, which removes its initializer. Force computation of the interface type first. There are better ways to model this in the AST, but it requires reworking how we handle initializers to break them into requests.
1 parent 817a12d commit 3f3df33

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Sema/TypeCheckMacros.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ evaluateAttachedMacro(MacroDecl *macro, Decl *attachedTo, CustomAttr *attr,
13301330
Optional<unsigned> swift::expandAccessors(
13311331
AbstractStorageDecl *storage, CustomAttr *attr, MacroDecl *macro
13321332
) {
1333+
(void)storage->getInterfaceType();
13331334
// Evaluate the macro.
13341335
auto macroSourceFile = evaluateAttachedMacro(macro, storage, attr,
13351336
/*passParentContext*/false,

0 commit comments

Comments
 (0)