Skip to content
  • Phil Hazelden's avatar
    5e3c2b05
    Don't suggest `DeriveAnyClass` when instance can't be derived. · 5e3c2b05
    Phil Hazelden authored and Marge Bot's avatar Marge Bot committed
    Fixes #19692.
    
    Prototypical cases:
    
        class C1 a where
          x1 :: a -> Int
        data G1 = G1 deriving C1
    
        class C2 a where
          x2 :: a -> Int
          x2 _ = 0
        data G2 = G2 deriving C2
    
    Both of these used to give this suggestion, but for C1 the suggestion
    would have failed (generated code with undefined methods, which compiles
    but warns). Now C2 still gives the suggestion but C1 doesn't.
    5e3c2b05
    Don't suggest `DeriveAnyClass` when instance can't be derived.
    Phil Hazelden authored and Marge Bot's avatar Marge Bot committed
    Fixes #19692.
    
    Prototypical cases:
    
        class C1 a where
          x1 :: a -> Int
        data G1 = G1 deriving C1
    
        class C2 a where
          x2 :: a -> Int
          x2 _ = 0
        data G2 = G2 deriving C2
    
    Both of these used to give this suggestion, but for C1 the suggestion
    would have failed (generated code with undefined methods, which compiles
    but warns). Now C2 still gives the suggestion but C1 doesn't.
Loading