Zubin pushed to branch wip/9.10.3-backports at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Tc/Solver/Monad.hs
    ... ... @@ -178,7 +178,7 @@ import GHC.Types.Var.Set
    178 178
     import GHC.Types.Unique.Supply
    
    179 179
     import GHC.Types.Unique.Set( elementOfUniqSet )
    
    180 180
     
    
    181
    -import GHC.Unit.Module ( HasModule, getModule, extractModule )
    
    181
    +import GHC.Unit.Module ( HasModule, getModule, extractModule, primUnit, moduleUnit, ghcInternalUnit)
    
    182 182
     import qualified GHC.Rename.Env as TcM
    
    183 183
     
    
    184 184
     import GHC.Utils.Outputable
    
    ... ... @@ -508,7 +508,11 @@ updSolvedDicts what dict_ct@(DictCt { di_cls = cls, di_tys = tys, di_ev = ev })
    508 508
         -- See Note [Using isCallStackTy in mentionsIP].
    
    509 509
         is_tyConTy :: (Type -> Bool) -> Name -> TcS (Type -> Bool)
    
    510 510
         is_tyConTy is_eq tc_name
    
    511
    -      = do { (mb_tc, _) <- wrapTcS $ TcM.tryTc $ TcM.tcLookupTyCon tc_name
    
    511
    +      = do {  mb_tc <- wrapTcS $ do
    
    512
    +                mod <- tcg_mod <$> TcM.getGblEnv
    
    513
    +                if moduleUnit mod `elem` [primUnit, ghcInternalUnit]
    
    514
    +                then return Nothing
    
    515
    +                else Just <$> TcM.tcLookupTyCon tc_name
    
    512 516
                ; case mb_tc of
    
    513 517
                   Just tc ->
    
    514 518
                     return $ \ ty -> not (typesAreApart ty (mkTyConTy tc))