Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jberryman
GHC
Commits
4848681c
Commit
4848681c
authored
21 years ago
by
Simon Peyton Jones
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2004-05-06 12:29:50 by simonpj]
Make addSrcSpan ignore unhelpful spans
parent
4ff9f4f8
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/typecheck/TcRnMonad.lhs
+5
-3
5 additions, 3 deletions
ghc/compiler/typecheck/TcRnMonad.lhs
with
5 additions
and
3 deletions
ghc/compiler/typecheck/TcRnMonad.lhs
+
5
−
3
View file @
4848681c
...
...
@@ -29,7 +29,7 @@ import VarEnv ( TidyEnv, emptyTidyEnv )
import ErrUtils ( Message, Messages, emptyMessages, errorsFound,
mkErrMsg, mkWarnMsg, printErrorsAndWarnings,
mkLocMessage, mkLongErrMsg )
import SrcLoc ( mkGeneralSrcSpan, SrcSpan, Located(..) )
import SrcLoc ( mkGeneralSrcSpan,
isGoodSrcSpan,
SrcSpan, Located(..) )
import NameEnv ( emptyNameEnv )
import NameSet ( emptyDUs, emptyNameSet )
import OccName ( emptyOccEnv )
...
...
@@ -99,7 +99,7 @@ initTc hsc_env mod do_this
} ;
lcl_env = TcLclEnv {
tcl_errs = errs_var,
tcl_loc = mkGeneralSrcSpan FSLIT("Top level
of module
"),
tcl_loc = mkGeneralSrcSpan FSLIT("Top level"),
tcl_ctxt = [],
tcl_rdr = emptyLocalRdrEnv,
tcl_th_ctxt = topStage,
...
...
@@ -374,7 +374,9 @@ getSrcSpanM :: TcRn SrcSpan
getSrcSpanM = do { env <- getLclEnv; return (tcl_loc env) }
addSrcSpan :: SrcSpan -> TcRn a -> TcRn a
addSrcSpan loc = updLclEnv (\env -> env { tcl_loc = loc })
addSrcSpan loc thing_inside
| isGoodSrcSpan loc = updLclEnv (\env -> env { tcl_loc = loc }) thing_inside
| otherwise = thing_inside -- Don't overwrite useful info with useless
addLocM :: (a -> TcM b) -> Located a -> TcM b
addLocM fn (L loc a) = addSrcSpan loc $ fn a
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment