You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sema: Don't forget to visit conformances introduced by non-generic types
Even if a nominal type does not have its own generic parameters,
we need to visit its conformances, because it might be defined
in a constrained extension or have a 'where' clause of its own.
Copy file name to clipboardExpand all lines: test/Sema/implementation-only-import-in-decls.swift
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -179,6 +179,13 @@ public struct NormalProtoAssocHolder<T: NormalProto> {
179
179
}
180
180
publicfunc testConformanceInBoundGeneric(_:NormalProtoAssocHolder<NormalStruct>){} // expected-error {{cannot use conformance of 'NormalStruct' to 'NormalProto' here; 'BADLibrary' has been imported as implementation-only}}
181
181
182
+
publicstructOuterGenericHolder<T>{
183
+
publicstructNestedwhere T :NormalProto{
184
+
publicvarvalue:T.Assoc
185
+
}
186
+
}
187
+
publicfunc testConformanceInNestedNonGeneric(_:OuterGenericHolder<NormalStruct>.Nested){} // expected-error {{cannot use conformance of 'NormalStruct' to 'NormalProto' here; 'BADLibrary' has been imported as implementation-only}}
188
+
182
189
publicclassSubclassOfNormalClass:NormalClass{}
183
190
184
191
publicfunc testInheritedConformance(_:NormalProtoAssocHolder<SubclassOfNormalClass>){} // expected-error {{cannot use conformance of 'NormalClass' to 'NormalProto' here; 'BADLibrary' has been imported as implementation-only}}
Copy file name to clipboardExpand all lines: test/Sema/spi-in-decls.swift
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -213,6 +213,13 @@ public struct NormalProtoAssocHolder<T: NormalProto> {
213
213
}
214
214
publicfunc testConformanceInBoundGeneric(_:NormalProtoAssocHolder<NormalStruct>){} // expected-error {{cannot use conformance of 'NormalStruct' to 'NormalProto' here; the conformance is declared as SPI}}
215
215
216
+
publicstructOuterGenericHolder<T>{
217
+
publicstructNestedwhere T :NormalProto{
218
+
publicvarvalue:T.Assoc
219
+
}
220
+
}
221
+
publicfunc testConformanceInNestedNonGeneric(_:OuterGenericHolder<NormalStruct>.Nested){} // expected-error {{cannot use conformance of 'NormalStruct' to 'NormalProto' here; the conformance is declared as SPI}}
222
+
216
223
publicclassSubclassOfNormalClass:NormalClass{}
217
224
218
225
publicfunc testInheritedConformance(_:NormalProtoAssocHolder<SubclassOfNormalClass>){} // expected-error {{cannot use conformance of 'NormalClass' to 'NormalProto' here; the conformance is declared as SPI}}
0 commit comments