Zubin pushed to branch wip/no-try-lookup at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Tc/Solver/Monad.hs
    ... ... @@ -557,7 +557,11 @@ updSolvedDicts what dict_ct@(DictCt { di_cls = cls, di_tys = tys, di_ev = ev })
    557 557
         -- See Note [Using isCallStackTy in mightMentionIP].
    
    558 558
         is_tyConTy :: (Type -> Bool) -> Name -> TcS (Type -> Bool)
    
    559 559
         is_tyConTy is_eq tc_name
    
    560
    -      = do { (mb_tc, _) <- wrapTcS $ TcM.tryTc $ TcM.tcLookupTyCon tc_name
    
    560
    +      = do {  mb_tc <- wrapTcS $ do
    
    561
    +                mod <- tcg_mod <$> TcM.getGblEnv
    
    562
    +                if moduleUnit mod `elem` [primUnit, ghcInternalUnit, bignumUnit]
    
    563
    +                then return Nothing
    
    564
    +                else Just <$> TcM.tcLookupTyCon tc_name
    
    561 565
                ; case mb_tc of
    
    562 566
                   Just tc ->
    
    563 567
                     return $ \ ty -> not (typesAreApart ty (mkTyConTy tc))