Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#16179 closed feature request (fixed)

Mention DerivingStrategies in the warning when DeriveAnyClass and GeneralizedNewtypeDeriving are both enabled

Reported by: ckoparkar Owned by:
Priority: normal Milestone: 8.10.1
Component: Compiler Version:
Keywords: deriving Cc: RyanGlScott, bgamari
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: deriving/should_compile/T16179.hs
Blocked By: Blocking:
Related Tickets: #15839 Differential Rev(s): https://gitlab.haskell.org/ghc/ghc/merge_requests/120
Wiki Page:

Description

When DeriveAnyClass and GeneralizedNewtypeDeriving are both enabled, GHC prints out the following warning for every deriving C:

warning:
    Both DeriveAnyClass and GeneralizedNewtypeDeriving are enabled
     Defaulting to the DeriveAnyClass strategy for instantiating C 

Would it be useful to point the users to DerivingStrategies ?

Use DerivingStrategies to pick a different strategy, or something similar? I'm not sure if this was already discussed before, I couldn't find any related tickets.

Change History (5)

comment:1 Changed 8 months ago by RyanGlScott

comment:2 Changed 8 months ago by RyanGlScott

That sounds like a reasonable thing to add to the warning.

comment:3 Changed 8 months ago by ckoparkar

Differential Rev(s): https://gitlab.haskell.org/ghc/ghc/merge_requests/120
Status: newpatch

comment:4 Changed 8 months ago by ckoparkar

Cc: bgamari added
Resolution: fixed
Status: patchclosed
Test Case: deriving/should_compile/T16179.hs

Fixed by 800d77e8.

comment:5 Changed 8 months ago by bgamari

Thanks ckoparkar!

Note: See TracTickets for help on using tickets.