This is mostly just cleanup: 1. Removes `diagnostic-descriptions.md` since it isn't used any more 2. Adds the group name to all the old notes files 3. Removes trailing whitespace 4. Adds "See Also" sections for notes that have links
1.6 KiB
Deprecated implementation-only imports (ImplementationOnlyDeprecated)
Warnings that identify import declarations with the @_implementationOnly attribute.
Overview
When applied to import declarations, the compiler-internal attribute @_implementationOnly attempts prevents declarations from the imported module from being exposed in the ABI or public interface of the dependent module. This attribute became deprecated when support for access levels on import declarations was introduced with SE-0409.
One reason @_implementationOnly import is deprecated is that it is unsafe when used in modules that are built without library evolution enabled. For example, suppose the following code were part of a library named Foo:
// Library `Foo`
@_implementationOnly import ImplementationDetail
public struct Bar {
internal var x: Baz // defined in ImplementationDetail
}
If Foo is not compiled with library evolution, then the memory layout of values of Bar must be known at compile time in clients of Foo. However, the @_implementationOnly import of ImplementationDetail prevents clients from being able to look up Baz which is a type that contributes to the layout of Foo. As a result, the layout of Foo will be miscalculated resulting in undefined behavior.