mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
@_implementationOnly was designed for use from resilient modules only, using it from non-resilient modules in unsupported. This change adds a warning about it. If anyone hits this warning, they should either enable library-evolution or consider adopting the new `internal import` when it is available as it handles this scenario properly. What leads to a crash: an @_implementationOnly import fully hides the dependency from indirect clients. This can lead to the compiler being unaware of some internal details of a non-resilient module when building a client against it. In turn this may lead to run time crashes from miscompilation. In general one could still use @_implementationOnly in a non-resilient modules as long as it's referenced only from function bodies. However, references from even non-public properties does lead to important memory layout information being hidden from clients of the module. rdar://78129903
56 KiB
56 KiB