Skip to content

Commit b5110ee

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. (cherry picked from commit ef7970b)
1 parent 0c088c2 commit b5110ee

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)