Skip to content

Commit 27deac5

Browse files
authored
Merge pull request #64342 from hborla/macro-attribute-circularity
[Macros] Use the original attribute list when gathering possible macro-generated names in the source lookup cache.
2 parents 7da0cd1 + c203b39 commit 27deac5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/AST/Module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ void SourceLookupCache::populateAuxiliaryDeclCache() {
350350
// macro does not produce the requested name, so the only impact is possibly
351351
// expanding earlier than needed / unnecessarily looking in the top-level
352352
// auxiliary decl cache.
353-
for (auto attrConst : decl->getSemanticAttrs().getAttributes<CustomAttr>()) {
353+
for (auto attrConst : decl->getAttrs().getAttributes<CustomAttr>()) {
354354
auto *attr = const_cast<CustomAttr *>(attrConst);
355355
UnresolvedMacroReference macroRef(attr);
356356
auto macroName = macroRef.getMacroName().getBaseIdentifier();

test/Concurrency/global_actor_function_types.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,13 @@ func test_global_actor_mismatch() {
386386
let _: @MainActor () -> T = fn // expected-error{{cannot convert value actor-isolated to 'GA' to specified type actor-isolated to 'MainActor'}}
387387
}
388388
}
389+
390+
struct GlobalType {}
391+
392+
@_Concurrency.MainActor
393+
extension global_actor_function_types.GlobalType {
394+
@_Concurrency.MainActor static func ==(
395+
lhs: global_actor_function_types.GlobalType,
396+
rhs: global_actor_function_types.GlobalType
397+
) -> Bool { true }
398+
}

0 commit comments

Comments
 (0)