- newImportedGlobalName mod occ HiFile `thenRn` \ name ->
- addOccurrenceName name `thenRn_`
- getSrcLocRn `thenRn` \ sloc ->
- let
- expr = HsApp (HsVar name)
+ mkImportedGlobalFromRdrName assertErr_RDR `thenRn` \ name ->
+ getSrcLocRn `thenRn` \ sloc ->
+
+ -- if we're ignoring asserts, return (\ _ e -> e)
+ -- if not, return (assertError "src-loc")
+
+ if opt_IgnoreAsserts then
+ getUniqRn `thenRn` \ uniq ->
+ let
+ vname = mkSysLocalName uniq SLIT("v")
+ expr = HsLam ignorePredMatch
+ loc = nameSrcLoc vname
+ ignorePredMatch = Match [] [WildPatIn, VarPatIn vname] Nothing
+ (GRHSs [GRHS [ExprStmt (HsVar vname) loc] loc]
+ EmptyBinds Nothing)
+ in
+ returnRn (expr, unitFV name)
+ else
+ let
+ expr =
+ HsApp (HsVar name)