summaryrefslogtreecommitdiff
path: root/testsuite/tests/module/mod71.stderr
diff options
context:
space:
mode:
authorMerijn Verstraaten <merijn@inconsistent.nl>2014-11-21 15:32:38 -0600
committerAustin Seipp <austin@well-typed.com>2014-11-21 17:04:57 -0600
commit2cc854b7133e38c7ad1107057931761782d03594 (patch)
tree399b3ccdcc7c43dce2e598d1ea42e72ff818000c /testsuite/tests/module/mod71.stderr
parent624a7c5a2eee0c0ba486a45550680052c2c79849 (diff)
downloadhaskell-2cc854b7133e38c7ad1107057931761782d03594.tar.gz
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@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
Diffstat (limited to 'testsuite/tests/module/mod71.stderr')
-rw-r--r--testsuite/tests/module/mod71.stderr11
1 files changed, 10 insertions, 1 deletions
diff --git a/testsuite/tests/module/mod71.stderr b/testsuite/tests/module/mod71.stderr
index f42d17de0c..7cf7e0bf7b 100644
--- a/testsuite/tests/module/mod71.stderr
+++ b/testsuite/tests/module/mod71.stderr
@@ -1,2 +1,11 @@
-mod71.hs:4:9: Pattern syntax in expression context: _
+mod71.hs:4:9:
+ Found hole ‘_’ with type: t1
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of f :: (t1 -> a -> t) -> t at mod71.hs:4:1
+ Relevant bindings include
+ x :: t1 -> a -> t (bound at mod71.hs:4:3)
+ f :: (t1 -> a -> t) -> t (bound at mod71.hs:4:1)
+ In the first argument of ‘x’, namely ‘_’
+ In the expression: x _ 1
+ In an equation for ‘f’: f x = x _ 1