File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -7041,7 +7041,8 @@ void AttributeChecker::visitRuntimeMetadataAttr(RuntimeMetadataAttr *attr) {
7041
7041
7042
7042
// Check whether type marked as runtime attribute capable has an initializer
7043
7043
// with first parameter labeled as `attachedTo:`.
7044
- for (auto *member : nominal->getMembers ()) {
7044
+ for (auto *member :
7045
+ nominal->lookupDirect (DeclBaseName::createConstructor ())) {
7045
7046
auto *init = dyn_cast<ConstructorDecl>(member);
7046
7047
if (!init)
7047
7048
continue ;
Original file line number Diff line number Diff line change @@ -157,3 +157,15 @@ class MembersWithAvailability {
157
157
func test_local_types_with_conformances( ) {
158
158
struct X : Flagged { }
159
159
}
160
+
161
+ @runtimeMetadata
162
+ struct AttrWithInitsInExts {
163
+ }
164
+
165
+ extension AttrWithInitsInExts {
166
+ init ( attachedTo: Any . Type ) { }
167
+ }
168
+
169
+ @AttrWithInitsInExts
170
+ struct TestAttrWithExts { // Ok
171
+ }
You can’t perform that action at this time.
0 commit comments