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
Terraform modules
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
Las Safin
GHC
Commits
f1bacb98
Commit
f1bacb98
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1997-09-04 19:54:32 by sof]
Tidied up error reporting code
parent
2a180772
Branches
wip/T19847
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/typecheck/TcModule.lhs
+28
-10
28 additions, 10 deletions
ghc/compiler/typecheck/TcModule.lhs
with
28 additions
and
10 deletions
ghc/compiler/typecheck/TcModule.lhs
+
28
−
10
View file @
f1bacb98
...
...
@@ -15,11 +15,12 @@ module TcModule (
IMP_Ubiq(){-uitous-}
import CmdLineOpts ( opt_D_dump_tc, opt_D_dump_deriv )
import HsSyn ( HsDecl(..), HsModule(..), HsBinds(..), HsExpr, MonoBinds(..),
TyDecl, SpecDataSig, ClassDecl, InstDecl, IfaceSig,
SpecInstSig, DefaultDecl, Sig, Fake, InPat,
SYN_IE(RecFlag), nonRecursive, GRHSsAndBinds, Match,
FixityDecl, IE, ImportDecl
FixityDecl, IE, ImportDecl
, OutPat
)
import RnHsSyn ( SYN_IE(RenamedHsModule), RenamedFixityDecl(..) )
import TcHsSyn ( SYN_IE(TypecheckedHsBinds), SYN_IE(TypecheckedHsExpr),
...
...
@@ -49,9 +50,11 @@ import TcKind ( TcKind )
import RnMonad ( RnNameSupply(..) )
import Bag ( listToBag )
import ErrUtils ( SYN_IE(Warning), SYN_IE(Error) )
import ErrUtils ( SYN_IE(Warning), SYN_IE(Error),
pprBagOfErrors, dumpIfSet, ghcExit
)
import Id ( idType, GenId, SYN_IE(IdEnv), nullIdEnv )
import Maybes ( catMaybes, MaybeErr )
import Maybes ( catMaybes, MaybeErr
(..)
)
import Name ( Name, isLocallyDefined, pprModule )
import Pretty
import TyCon ( TyCon, isSynTyCon )
...
...
@@ -72,7 +75,7 @@ import Bag ( Bag, isEmptyBag )
import FiniteMap ( emptyFM, FiniteMap )
import Outputable ( Outputable(..), PprStyle )
import Outputable ( Outputable(..), PprStyle
, printErrs, pprDumpStyle, pprErrorsStyle
)
tycon_specs = emptyFM
\end{code}
...
...
@@ -107,14 +110,29 @@ typecheckModule
:: UniqSupply
-> RnNameSupply
-> RenamedHsModule
-> MaybeErr
(TcResults, -- if all goes well...
Bag Warning) -- (we can still get warnings)
(Bag Error, -- if we had errors...
Bag Warning)
-> IO (Maybe TcResults)
typecheckModule us rn_name_supply mod
= initTc us (tcModule rn_name_supply mod)
= case initTc us (tcModule rn_name_supply mod) of
Failed (errs, warns) ->
print_errs warns >>
print_errs errs >>
return Nothing
Succeeded (results@(binds, _, _, _, _, dump_deriv), warns) ->
print_errs warns >>
dumpIfSet opt_D_dump_tc "Typechecked"
(ppr pprDumpStyle binds) >>
dumpIfSet opt_D_dump_deriv "Derived instances"
(dump_deriv pprDumpStyle) >>
return (Just results)
print_errs errs
| isEmptyBag errs = return ()
| otherwise = printErrs (pprBagOfErrors pprErrorsStyle errs)
\end{code}
The internal monster:
...
...
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