diff options
Diffstat (limited to 'compiler/GHC/Tc/Deriv/Utils.hs')
-rw-r--r-- | compiler/GHC/Tc/Deriv/Utils.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Deriv/Utils.hs b/compiler/GHC/Tc/Deriv/Utils.hs index d97db525eb..dfd1b557a7 100644 --- a/compiler/GHC/Tc/Deriv/Utils.hs +++ b/compiler/GHC/Tc/Deriv/Utils.hs @@ -930,6 +930,9 @@ cond_functorOK allowFunctions allowExQuantifiedLastTyVar _ _ rep_tc | null tc_tvs = NotValid $ DerivErrMustHaveSomeParameters rep_tc + -- We can't handle stupid contexts that mention the last type argument, + -- so error out if we encounter one. + -- See Note [The stupid context] in GHC.Core.DataCon. | not (null bad_stupid_theta) = NotValid $ DerivErrMustNotHaveClassContext rep_tc bad_stupid_theta |