From 9a54165fb4ea3dee2832c09bb1d658938b523094 Mon Sep 17 00:00:00 2001 From: Zubin Duggal Date: Fri, 5 Jan 2024 16:14:01 +0530 Subject: [PATCH] Adapt to minor API change for 9.6.4 compatibility The CPP will need to be adjusted again for 9.8.2 as the patch is likely to be backported there as well. --- ghcide/src/Development/IDE/Import/FindImports.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghcide/src/Development/IDE/Import/FindImports.hs b/ghcide/src/Development/IDE/Import/FindImports.hs index 358666a0e9..5fe250c9ce 100644 --- a/ghcide/src/Development/IDE/Import/FindImports.hs +++ b/ghcide/src/Development/IDE/Import/FindImports.hs @@ -219,7 +219,11 @@ notFoundErr env modName reason = } LookupUnusable unusable -> let unusables' = map get_unusable unusable +#if MIN_VERSION_ghc(9,6,4) && !MIN_VERSION_ghc(9,8,1) + get_unusable (m, ModUnusable r) = r +#else get_unusable (m, ModUnusable r) = (moduleUnit m, r) +#endif get_unusable (_, r) = pprPanic "findLookupResult: unexpected origin" (ppr r) in notFound {fr_unusables = unusables'}