diff options
| author | Chaitanya Koparkar <ckoparkar@gmail.com> | 2019-01-14 14:36:29 -0500 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-01-20 05:24:59 -0500 |
| commit | 800d77e882f24066a7f6d818b2606ad8a0e79e02 (patch) | |
| tree | 6e7d9b4673499c1cb29214641571f27e8c32a2e8 /compiler | |
| parent | b137ab75ab269e043e0783e41ac704d1be5570c6 (diff) | |
| download | haskell-800d77e882f24066a7f6d818b2606ad8a0e79e02.tar.gz | |
Mention DerivingStrategies in the warning when DAC and GND are both enabled
Summary:
When DeriveAnyClass and GeneralizedNewtypeDeriving are both enabled,
GHC prints out a warning that specifies the strategy it used to
derive a class. This patch updates the warning to mention that users
may pick a particular strategy by using DerivingStrategies.
Test plan: make test TEST=T16179
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/typecheck/TcDeriv.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index 90b230a972..6078a7a7ff 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -1640,7 +1640,10 @@ mkNewTypeEqn [ text "Both DeriveAnyClass and" <+> text "GeneralizedNewtypeDeriving are enabled" , text "Defaulting to the DeriveAnyClass strategy" - <+> text "for instantiating" <+> ppr cls ] + <+> text "for instantiating" <+> ppr cls + , text "Use DerivingStrategies to pick" + <+> text "a different strategy" + ] mk_originative_eqn DerivSpecAnyClass -- CanDeriveStock CanDeriveStock gen_fn -> mk_originative_eqn $ |
