diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-06-19 15:56:24 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2020-06-26 09:46:21 +0100 |
commit | e5cdb1c8035f2447017867f96873aa71e6835906 (patch) | |
tree | b65db16256741f570fbb2509694be11abfbcea7e /compiler/GHC/HsToCore/PmCheck/Oracle.hs | |
parent | a3d69dc6c2134afe239caf4f881ba5542d2c2be0 (diff) | |
download | haskell-wip/T18304.tar.gz |
Better loop detection in findTypeShapewip/T18304
Andreas pointed out, in !3466, that my fix for #18304 was not
quite right. This patch fixes it properly, by having just one
RecTcChecker rather than (implicitly) two nested ones, in
findTypeShape.
Diffstat (limited to 'compiler/GHC/HsToCore/PmCheck/Oracle.hs')
-rw-r--r-- | compiler/GHC/HsToCore/PmCheck/Oracle.hs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/compiler/GHC/HsToCore/PmCheck/Oracle.hs b/compiler/GHC/HsToCore/PmCheck/Oracle.hs index db56ecc98c..80a844ad19 100644 --- a/compiler/GHC/HsToCore/PmCheck/Oracle.hs +++ b/compiler/GHC/HsToCore/PmCheck/Oracle.hs @@ -372,16 +372,9 @@ pmTopNormaliseType (TySt inert) typ tyFamStepper :: FamInstEnvs -> NormaliseStepper ([Type] -> [Type], a -> a) tyFamStepper env rec_nts tc tys -- Try to step a type/data family - = let (_args_co, ntys, _res_co) = normaliseTcArgs env Representational tc tys in - -- NB: It's OK to use normaliseTcArgs here instead of - -- normalise_tc_args (which takes the LiftingContext described - -- in Note [Normalising types]) because the reduceTyFamApp below - -- works only at top level. We'll never recur in this function - -- after reducing the kind of a bound tyvar. - - case reduceTyFamApp_maybe env Representational tc ntys of - Just (_co, rhs) -> NS_Step rec_nts rhs ((rhs:), id) - _ -> NS_Done + = case topReduceTyFamApp_maybe env tc tys of + Just (_, rhs, _) -> NS_Step rec_nts rhs ((rhs:), id) + _ -> NS_Done -- | Returns 'True' if the argument 'Type' is a fully saturated application of -- a closed type constructor. |