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}}
146
150
147
151
packageimport UnusedPackageImport // expected-warning {{package import of 'UnusedPackageImport' was not used in package declarations}} {{1-9=}}
152
+
packageimport ExtendedPackageTypeImport
148
153
publicimport ImportNotUseFromAPI // expected-warning {{public import of 'ImportNotUseFromAPI' was not used in public declarations or inlinable code}} {{1-8=}}
149
154
publicimport ImportUsedInPackage // expected-warning {{public import of 'ImportUsedInPackage' was not used in public declarations or inlinable code}} {{1-7=package}}
150
155
@@ -243,6 +248,10 @@ public protocol Countable {
243
248
extensionExtended:Countable{ // expected-remark {{struct 'Extended' is imported via 'RetroactiveConformance'}}
244
249
}
245
250
251
+
extensionExtendedPackageType{ // expected-remark {{struct 'ExtendedPackageType' is imported via 'ExtendedPackageTypeImport'}}
0 commit comments