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: Register the extended type of a package-level extension
The warnings on superfluously public/package imports has a hole where
it could report a package import as not being used by package decls
even if it provides a type extended by a package extension. This is
caused by the exportability checker not being enabled for package
decls, thus not triggering the usual logic registering this reference.
Address this issue by adding a check specifically for package extensions.
We can remove this check once we have exportability checking for package
decls.
rdar://126712864
// expected-warning @-1 {{module 'UnusedImport' is imported as 'public' from the same file; this 'package' access level will be ignored}}
144
148
145
149
packageimport UnusedPackageImport // expected-warning {{package import of 'UnusedPackageImport' was not used in package declarations}} {{1-9=}}
150
+
packageimport ExtendedPackageTypeImport
146
151
publicimport ImportNotUseFromAPI // expected-warning {{public import of 'ImportNotUseFromAPI' was not used in public declarations or inlinable code}} {{1-8=}}
147
152
publicimport ImportUsedInPackage // expected-warning {{public import of 'ImportUsedInPackage' was not used in public declarations or inlinable code}} {{1-7=package}}
148
153
@@ -241,6 +246,10 @@ public protocol Countable {
241
246
extensionExtended:Countable{ // expected-remark {{struct 'Extended' is imported via 'RetroactiveConformance'}}
242
247
}
243
248
249
+
extensionExtendedPackageType{ // expected-remark {{struct 'ExtendedPackageType' is imported via 'ExtendedPackageTypeImport'}}
0 commit comments