Make -XDeriveFunctor more generous about non-last arguments (Trac #8678)
When deriving Functor, Foldable, Traversable, we need only look at the way that the last type argument is treated. It's fine for there to be existentials etc, provided they don't affect the last type argument. See Note [Check that the type variable is truly universal] in TcDeriv.
Showing
- compiler/typecheck/TcDeriv.lhs 66 additions, 22 deletionscompiler/typecheck/TcDeriv.lhs
- compiler/typecheck/TcGenDeriv.lhs 4 additions, 4 deletionscompiler/typecheck/TcGenDeriv.lhs
- docs/users_guide/glasgow_exts.xml 7 additions, 0 deletionsdocs/users_guide/glasgow_exts.xml
- testsuite/tests/deriving/should_compile/T8678.hs 12 additions, 0 deletionstestsuite/tests/deriving/should_compile/T8678.hs
- testsuite/tests/deriving/should_compile/all.T 2 additions, 1 deletiontestsuite/tests/deriving/should_compile/all.T
- testsuite/tests/deriving/should_fail/T3101.stderr 1 addition, 1 deletiontestsuite/tests/deriving/should_fail/T3101.stderr
- testsuite/tests/generics/GenCannotDoRep0_0.stderr 2 additions, 1 deletiontestsuite/tests/generics/GenCannotDoRep0_0.stderr
- testsuite/tests/generics/GenCannotDoRep1_0.stderr 2 additions, 1 deletiontestsuite/tests/generics/GenCannotDoRep1_0.stderr
- testsuite/tests/typecheck/should_fail/tcfail086.stderr 1 addition, 1 deletiontestsuite/tests/typecheck/should_fail/tcfail086.stderr
Loading
Please register or sign in to comment