mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
5d91a25306
Disabling it per target works nicely for compilation but it gets annoying in ghci since the warnings are still triggered. We could disable it everywhere but I think the warning is generally useful. I tried patching proto3-suite to use DerivingStrategies but that doesn’t work because haskell-src is dead and doesn’t support it. So for now adding it to the per-file list seems like the best option. changelog_begin changelog_end
22 lines
1.0 KiB
Diff
22 lines
1.0 KiB
Diff
GHC 8.10 enables -Wderiving-defaults as part of -Wall.
|
||
It’s a useful warning so we want to keep it. However,
|
||
proto3-suite generates code that triggers this warning.
|
||
Now ideally, we would just switch proto3-suite over to
|
||
DerivingStrategies but unfortunately haskell-src, the library
|
||
used to generate the Haskell source, does not support that.
|
||
So instead, we disable the warning on a per file basis.
|
||
The warning only exists in GHC >= 8.10 so we cannot
|
||
upstream this atm.
|
||
diff --git a/src/Proto3/Suite/DotProto/Generate.hs b/src/Proto3/Suite/DotProto/Generate.hs
|
||
index 566b8a9..fae46a4 100644
|
||
--- a/src/Proto3/Suite/DotProto/Generate.hs
|
||
+++ b/src/Proto3/Suite/DotProto/Generate.hs
|
||
@@ -127,6 +127,7 @@ renderHsModuleForDotProto extraInstanceFiles dotProto importCtxt = do
|
||
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
|
||
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
|
||
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
|
||
+ {-# OPTIONS_GHC -Wno-deriving-defaults #-}
|
||
|
||
-- | Generated by Haskell protocol buffer compiler. DO NOT EDIT!
|
||
|]
|