File tree 3 files changed +15
-2
lines changed
test/Serialization/Inputs
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -2378,7 +2378,7 @@ bool CustomAttr::isArgUnsafe() const {
2378
2378
2379
2379
bool CustomAttr::isAttachedMacro (const Decl *decl) const {
2380
2380
auto &ctx = decl->getASTContext ();
2381
- auto *dc = decl->getInnermostDeclContext ();
2381
+ auto *dc = decl->getDeclContext ();
2382
2382
2383
2383
auto *macroDecl = evaluateOrDefault (
2384
2384
ctx.evaluator ,
Original file line number Diff line number Diff line change @@ -698,7 +698,7 @@ bool SemaAnnotator::handleCustomAttributes(Decl *D) {
698
698
// If this attribute resolves to a macro, index that.
699
699
ASTContext &ctx = D->getASTContext ();
700
700
ResolveMacroRequest req{const_cast <CustomAttr *>(customAttr),
701
- D->getInnermostDeclContext ()};
701
+ D->getDeclContext ()};
702
702
if (auto macroDecl = evaluateOrDefault (ctx.evaluator , req, nullptr )) {
703
703
Type macroRefType = macroDecl->getDeclaredInterfaceType ();
704
704
if (!passReference (
Original file line number Diff line number Diff line change 11
11
public struct S {
12
12
public var value : Int
13
13
}
14
+
15
+ public struct Base {
16
+ public static func member( ) -> Base { . init( ) }
17
+ }
18
+
19
+ @attached ( memberAttribute) public macro wrapAllProperties(
20
+ _ : Base
21
+ ) = #externalMacro( module: " MacroDefinition " , type: " WrapAllProperties " )
22
+
23
+ @wrapAllProperties ( . member( ) )
24
+ public struct TestMacroArgTypechecking {
25
+ public var value : Int
26
+ }
You can’t perform that action at this time.
0 commit comments