Fix #23007
Previously, data family instances would be treated differently from data type definitions wrt. unused type variables/patterns: ```haskell newtype Const a b = Const a data family Const' a b newtype instance Const' a b = Const' a ``` The above will warn for `Const'` but not for `Const` because of `b` isn't mentioned on the RHS. This leads to the awkward situation, where if you fix it and make it `_b`, the type becomes the following: ```haskell :t Const' Const' :: a -> Const' a _b ``` This is suboptimal.
Showing
- compiler/GHC/Rename/Module.hs 9 additions, 1 deletioncompiler/GHC/Rename/Module.hs
- testsuite/tests/indexed-types/should_compile/UnusedTyVarWarnings.hs 4 additions, 1 deletion...tests/indexed-types/should_compile/UnusedTyVarWarnings.hs
- testsuite/tests/indexed-types/should_compile/UnusedTyVarWarnings.stderr 0 additions, 3 deletions...s/indexed-types/should_compile/UnusedTyVarWarnings.stderr
- testsuite/tests/indexed-types/should_compile/UnusedTyVarWarningsNamedWCs.hs 4 additions, 1 deletion...dexed-types/should_compile/UnusedTyVarWarningsNamedWCs.hs
- testsuite/tests/indexed-types/should_compile/UnusedTyVarWarningsNamedWCs.stderr 0 additions, 3 deletions...d-types/should_compile/UnusedTyVarWarningsNamedWCs.stderr
Loading
Please register or sign in to comment