Commit 640fe142 authored by Edward Z. Yang's avatar Edward Z. Yang

Remove unnecessary loadInterface for TH quoted name.

Summary:
The load was introduced a32d3e4d
to fix a bug where deprecations assumed that the name in question
had already had their interface loaded.  The new deprecation
code no longer makes this assumption and just loads the interface,
so this eager load is not necessary.

Verified that TH_reifyType2 continues to work.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: simonpj, austin

Subscribers: bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D891

GHC Trac Issues: #10419
parent ce166a3a
......@@ -22,7 +22,6 @@ import Kind
import RnEnv
import RnSource ( rnSrcDecls, findSplice )
import RnPat ( rnPat )
import LoadIface ( loadInterfaceForName )
import BasicTypes ( TopLevelFlag, isTopLevel )
import Outputable
import Module
......@@ -98,10 +97,8 @@ rn_bracket outer_stage br@(VarBr flg rdr_name)
= do { name <- lookupOccRn rdr_name
; this_mod <- getModule
; case flg of
{ -- Type variables can be quoted in TH. See #5721.
False -> return ()
; True | nameIsLocalOrFrom this_mod name ->
; when (flg && nameIsLocalOrFrom this_mod name) $
-- Type variables can be quoted in TH. See #5721.
do { mb_bind_lvl <- lookupLocalOccThLvl_maybe name
; case mb_bind_lvl of
{ Nothing -> return () -- Can happen for data constructors,
......@@ -116,15 +113,7 @@ rn_bracket outer_stage br@(VarBr flg rdr_name)
(quotedNameStageErr br) }
}
}
; True | otherwise -> -- Imported thing
discardResult (loadInterfaceForName msg name)
-- Reason for loadInterface: deprecation checking
-- assumes that the home interface is loaded, and
-- this is the only way that is going to happen
}
; return (VarBr flg name, unitFV name) }
where
msg = ptext (sLit "Need interface for Template Haskell quoted Name")
rn_bracket _ (ExpBr e) = do { (e', fvs) <- rnLExpr e
; return (ExpBr e', fvs) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment