diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-01-08 11:57:32 +0100 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-01-08 12:16:20 +0100 |
commit | c1e24faa9579dd4b50a46c65ebe3f3a292139422 (patch) | |
tree | 94890ed5c935804f22a0fcc2938321a627943dcd /compiler/GHC/Tc/Solver.hs | |
parent | bd877edd9499a351db947cd51ed583872b2facdf (diff) | |
download | haskell-wip/better-default.tar.gz |
Improve defaulting detection codewip/better-default
As suggested at https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4701#note_322397
This makes sure that the code does not create an ill-kinded type.
Diffstat (limited to 'compiler/GHC/Tc/Solver.hs')
-rw-r--r-- | compiler/GHC/Tc/Solver.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Solver.hs b/compiler/GHC/Tc/Solver.hs index 991708111d..3a5d771a88 100644 --- a/compiler/GHC/Tc/Solver.hs +++ b/compiler/GHC/Tc/Solver.hs @@ -757,13 +757,12 @@ simplifyInteractive wanteds ------------------ simplifyDefault :: ThetaType -- Wanted; has no type variables in it - -> TcM () -- Succeeds if the constraint is soluble + -> TcM Bool -- Return if the constraint is soluble simplifyDefault theta = do { traceTc "simplifyDefault" empty ; wanteds <- newWanteds DefaultOrigin theta ; unsolved <- runTcSDeriveds (solveWantedsAndDrop (mkSimpleWC wanteds)) - ; reportAllUnsolved unsolved - ; return () } + ; return (isEmptyWC unsolved) } ------------------ tcCheckSatisfiability :: InertSet -> Bag EvVar -> TcM (Maybe InertSet) |