Skip to content

Fix #23305 - replace incorrect logger returned from the inside of withDeferredDiagnostics

Ian-Woo Kim requested to merge wavewave/ghc:T23305 into master

The log_hook of logger in HscEnv is temporarily appended inside withDeferredDiagnostics and the hook is removed in finalizer of bracket. But the returned HscEnv from the upsweep call contains that transient state of the logger. This results in swallowing error messages with -fdefer-diagnostics reported in #23305 (closed). In this patch, the original logger is reinstated when setting the new environment with the result of upsweep.

Edited by Ian-Woo Kim

Merge request reports