mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When writing decls to a swiftmodule files, the serialization logic evaluates whether the decl will be safe to deserialize. This is inferred from the access level of the decl, whether it's local, if the module is built for testing, etc. If the decl in unsafe to deserialize, a record will be written down before the decl itself in the swiftmodule file. On the reader side, attempting to deserialize a decl marked as unsafe raises a deserialization error early. This error is handled by the existing deserialization recovery logic. In theory, we want to consider as safe only decls that are actually needed by the client. Marking as many internal details as possible as unsafe will prevent more errors. Getting the right scope may require more work in the future.
241 KiB
241 KiB