Use unsatisfiable for missing methods w/ defaults
When a class instance has an Unsatisfiable constraint in its context and the user has not explicitly provided an implementation of a method, we now always provide a RHS of the form `unsatisfiable @msg`, even if the method has a default definition available. This ensures that, when deferring type errors, users get the appropriate error message instead of a possible runtime loop, if class default methods were defined recursively. Fixes #23816
Showing
- compiler/GHC/Tc/Errors.hs 6 additions, 2 deletionscompiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/TyCl/Instance.hs 33 additions, 29 deletionscompiler/GHC/Tc/TyCl/Instance.hs
- testsuite/tests/unsatisfiable/T23816.hs 18 additions, 0 deletionstestsuite/tests/unsatisfiable/T23816.hs
- testsuite/tests/unsatisfiable/T23816.stderr 6 additions, 0 deletionstestsuite/tests/unsatisfiable/T23816.stderr
- testsuite/tests/unsatisfiable/all.T 2 additions, 0 deletionstestsuite/tests/unsatisfiable/all.T
Loading
Please register or sign in to comment