summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r--compiler/GHC/Tc/Validity.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs
index 9d6a05c7aa..cad2ea1796 100644
--- a/compiler/GHC/Tc/Validity.hs
+++ b/compiler/GHC/Tc/Validity.hs
@@ -1417,6 +1417,10 @@ check_special_inst_head dflags is_boot is_sig ctxt clas cls_args
; when (safeInferOn dflags) (recordUnsafeInfer emptyMessages) }
| clas_nm == hasFieldClassName
+ , not quantified_constraint
+ -- Don't do any validity checking for HasField contexts
+ -- inside quantified constraints (#20989): the validity checks
+ -- only apply to user-written instances.
= checkHasFieldInst clas cls_args
| isCTupleClass clas