[commit: ghc] master: Add -fdefer-typed-holes flag which defers hole errors to runtime. (2cc854b)
git at git.haskell.org
git at git.haskell.org
Fri Nov 21 23:05:06 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/2cc854b7133e38c7ad1107057931761782d03594/ghc
>---------------------------------------------------------------
commit 2cc854b7133e38c7ad1107057931761782d03594
Author: Merijn Verstraaten <merijn at inconsistent.nl>
Date: Fri Nov 21 15:32:38 2014 -0600
Add -fdefer-typed-holes flag which defers hole errors to runtime.
Summary:
As proposed by Richard on Trac. This patch adds a new flag -fdefer-typed-holes
and changes the semantics of the -fno-warn-typed-holes flag.
To summarise, by default GHC has typed holes enabled and produces a compile
error when it encounters a typed hole.
When -fdefer-type-errors OR -fdefer-typed-holes is enabled, hole errors are
converted to warnings and result in runtime errors when evaluated.
The warning flag -fwarn-typed-holes is on by default. Without -fdefer-type-errors
or -fdefer-typed-holes this flag is a no-op, since typed holes are an error
under these conditions. If either of the defer flags are enabled (converting
typed hole errors into warnings) the -fno-warn-typed-holes flag disables the
warnings. This means compilation silently succeeds and evaluating a hole will
produce a runtime error.
The rationale behind allowing typed holes warnings to be silenced is that tools
like Syntastic for vim highlight warnings and hole warnings may be undesirable.
Signed-off-by: Merijn Verstraaten <merijn at inconsistent.nl>
Test Plan: validate
Reviewers: austin, simonpj, thomie
Reviewed By: simonpj, thomie
Subscribers: Fuuzetsu, thomie, carter
Differential Revision: https://phabricator.haskell.org/D442
GHC Trac Issues: #9497
Conflicts:
compiler/main/DynFlags.hs
>---------------------------------------------------------------
2cc854b7133e38c7ad1107057931761782d03594
compiler/main/DynFlags.hs | 22 +++++--
compiler/rename/RnExpr.lhs | 9 +--
compiler/typecheck/TcDeriv.lhs | 2 +-
compiler/typecheck/TcErrors.lhs | 74 +++++++++++++++++-----
compiler/typecheck/TcRnDriver.lhs | 2 +-
docs/users_guide/flags.xml | 25 +++++++-
docs/users_guide/glasgow_exts.xml | 53 ++++++++++------
docs/users_guide/using.xml | 34 +++++++---
testsuite/tests/module/mod71.stderr | 11 +++-
.../tests/rename/should_fail/rnfail016.stderr | 2 -
testsuite/tests/typecheck/should_compile/T9497a.hs | 2 +
.../tests/typecheck/should_compile/T9497a.stderr | 6 ++
testsuite/tests/typecheck/should_compile/T9497b.hs | 2 +
.../tests/typecheck/should_compile/T9497b.stderr | 0
testsuite/tests/typecheck/should_compile/T9497c.hs | 2 +
.../tests/typecheck/should_compile/T9497c.stderr | 0
testsuite/tests/typecheck/should_compile/all.T | 3 +
testsuite/tests/typecheck/should_fail/T9497d.hs | 2 +
.../tests/typecheck/should_fail/T9497d.stderr | 6 ++
testsuite/tests/typecheck/should_fail/all.T | 1 +
testsuite/tests/typecheck/should_run/T9497a-run.hs | 2 +
.../tests/typecheck/should_run/T9497a-run.stderr | 7 ++
testsuite/tests/typecheck/should_run/T9497b-run.hs | 2 +
.../tests/typecheck/should_run/T9497b-run.stderr | 7 ++
testsuite/tests/typecheck/should_run/T9497c-run.hs | 2 +
.../tests/typecheck/should_run/T9497c-run.stderr | 7 ++
testsuite/tests/typecheck/should_run/all.T | 3 +
27 files changed, 226 insertions(+), 62 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2cc854b7133e38c7ad1107057931761782d03594
More information about the ghc-commits
mailing list