mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
15bf131fed
GHC hates its users and defaults to optimizing out assertions. We fixed that in Buck at some point but clearly that got lost when migrating to Bazel. Turns out enabling assertions catches bugs. This insight was brought to you from the people that also brought you “Turns out writing tests catches bugs”. fixes #5624 changelog_begin changelog_end
21 lines
785 B
Diff
21 lines
785 B
Diff
diff --git a/src/Development/IDE/Core/Shake.hs b/src/Development/IDE/Core/Shake.hs
|
|
index a471070..a2b3183 100644
|
|
--- a/src/Development/IDE/Core/Shake.hs
|
|
+++ b/src/Development/IDE/Core/Shake.hs
|
|
@@ -503,7 +503,14 @@ isBadDependency x
|
|
newtype Q k = Q (k, NormalizedFilePath)
|
|
deriving (Eq,Hashable,NFData, Generic)
|
|
|
|
-instance Binary k => Binary (Q k)
|
|
+instance Binary k => Binary (Q k) where
|
|
+ put (Q (k, fp)) = put (k, fp)
|
|
+ get = do
|
|
+ (k, fp) <- get
|
|
+ -- The `get` implementation of NormalizedFilePath
|
|
+ -- does not handle empty file paths so we
|
|
+ -- need to handle this ourselves here.
|
|
+ pure (Q (k, toNormalizedFilePath' fp))
|
|
|
|
instance Show k => Show (Q k) where
|
|
show (Q (k, file)) = show k ++ "; " ++ fromNormalizedFilePath file
|