Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/Sema/TypeCheckDeclPrimary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1821,9 +1821,13 @@ class DeclChecker : public DeclVisitor<DeclChecker> {

void visit(Decl *decl) {
// Visit auxiliary decls first.
decl->visitAuxiliaryDecls([&](Decl *auxiliaryDecl) {
this->visit(auxiliaryDecl);
});
// We don't do this for members of classes because it happens as part of
// visiting their ABI members.
if (!isa<ClassDecl>(decl->getDeclContext())) {
decl->visitAuxiliaryDecls([&](Decl *auxiliaryDecl) {
this->visit(auxiliaryDecl);
});
}

if (auto *Stats = getASTContext().Stats)
++Stats->getFrontendCounters().NumDeclsTypechecked;
Expand Down
8 changes: 8 additions & 0 deletions test/Macros/macro_expand_peers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ func useCompletionHandlerG(s: S, _ body: @escaping (String) -> Void) {
}
}

class C {
@addCompletionHandler
func f(a: Int, for b: String, _ value: Double) async -> String {
return b
}
}


@addCompletionHandler
func f(a: Int, for b: String, _ value: Double) async -> String {
return b
Expand Down