We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3e32a4c + de4ff37 commit db141afCopy full SHA for db141af
lib/Sema/TypeCheckAttr.cpp
@@ -2643,7 +2643,7 @@ void AttributeChecker::visitFrozenAttr(FrozenAttr *attr) {
2643
}
2644
2645
void AttributeChecker::visitCustomAttr(CustomAttr *attr) {
2646
- auto dc = D->getInnermostDeclContext();
+ auto dc = D->getDeclContext();
2647
2648
// Figure out which nominal declaration this custom attribute refers to.
2649
auto nominal = evaluateOrDefault(
test/NameBinding/custom-attr-on-extension.swift
@@ -0,0 +1,9 @@
1
+// RUN: %target-swift-frontend -typecheck %s -verify
2
+
3
+// Trips an assertion if an ASTScope lookup is attempted into the innermost
4
+// DeclContext of the extension.
5
6
+struct Ty{}
7
8
+@foo extension Ty {} // expected-error {{unknown attribute 'foo'}}
9
0 commit comments