diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Tc/Module.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index 10461ad5fe..115c64f341 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -2625,12 +2625,13 @@ tcRnType hsc_env flexi normalise rdr_type -- Do validity checking on type ; checkValidType (GhciCtxt True) ty - ; ty' <- if normalise - then do { fam_envs <- tcGetFamInstEnvs - ; let (_, ty') - = normaliseType fam_envs Nominal ty - ; return ty' } - else return ty ; + -- Optionally (:k vs :k!) normalise the type. Does two things: + -- normaliseType: expand type-family applications + -- expandTypeSynonyms: expand type synonyms (#18828) + ; fam_envs <- tcGetFamInstEnvs + ; let ty' | normalise = expandTypeSynonyms $ snd $ + normaliseType fam_envs Nominal ty + | otherwise = ty ; return (ty', mkInfForAllTys kvs (tcTypeKind ty')) } |