mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When running in the allow errors mode (-experimental-allow-module-with-compiler-errors), modules may contain invalid declarations. The rest of the compiler pipeline, however, expects to have valid declarations unless diagnostics have emitted an error. Emit an error while deserializing to maintain this assumption. Note that these errors will not have a useful location, unless there's a corresponding `.swiftsourceinfo`. This isn't a problem for the intended use case in IDEs, where diagnostics outside the current file would be ignored anyway. Since reading declarations is lazy, SILGen (and thus SIL diagnostics) can still run as long as any invalid declarations weren't referenced in the compiling module. Resolves rdar://74325388