mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Make sure we flush the diagnostics consumers to prevent the new diagnostic style to buffer the deserialization errors without printing them. These errors may be printed right before an `abort()`, which would bypass the actual printing of the errors. Take advantage of the new style to make these diagnostics more readable as well. ``` .../LibWithXRef.swiftmodule:1:1: remark: reference to type 'MyType' broken by a context change; 'MyType' was expected to be in 'A', but now a candidate is found only in 'A_related' 1 │ A.MyType │ ├─ remark: reference to type 'MyType' broken by a context change; 'MyType' was expected to be in 'A', but now a candidate is found only in 'A_related' │ ├─ note: the type was expected to be found in module 'A' at ‘.../A.swiftmodule' │ ├─ note: or expected to be found in the underlying module 'A' defined at ‘.../module.modulemap' │ ├─ note: the type was actually found in module 'A_related' at ‘.../A_related.swiftmodule' │ ├─ note: the module 'LibWithXRef' was built with a Swift language version set to 5.10 while the current invocation uses 4.1.50; APINotes may change how clang declarations are imported │ ├─ note: the module 'LibWithXRef' has enabled library-evolution; the following file may need to be deleted if the SDK was modified: ‘.../LibWithXRef.swiftmodule' │ ├─ note: declarations in the underlying clang module 'A' may be hidden by clang preprocessor macros │ ├─ note: the distributed module 'LibWithXRef' refers to the local module 'A'; this may be caused by header maps or search paths │ ╰─ note: the type 'MyType' moved between related modules; clang preprocessor macros may affect headers shared between these modules .../LibWithXRef.swiftmodule:1:1: note: could not deserialize type for 'foo()' 1 │ A.MyType │ ╰─ note: could not deserialize type for 'foo()' ``` rdar://124700605
4.4 KiB
4.4 KiB