Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
778b48af
Commit
778b48af
authored
Jan 15, 2014
by
Austin Seipp
Browse files
s/warn-type-holes/warn-typed-holes/g
Signed-off-by:
Austin Seipp
<
austin@well-typed.com
>
parent
89c83d66
Changes
8
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
778b48af
...
...
@@ -464,7 +464,7 @@ data WarningFlag =
|
Opt_WarnUnsupportedCallingConventions
|
Opt_WarnUnsupportedLlvmVersion
|
Opt_WarnInlineRuleShadowing
|
Opt_WarnTypeHoles
|
Opt_WarnType
d
Holes
deriving
(
Eq
,
Show
,
Enum
)
data
Language
=
Haskell98
|
Haskell2010
...
...
@@ -2575,7 +2575,7 @@ fWarningFlags = [
(
"warn-identities"
,
Opt_WarnIdentities
,
nop
),
(
"warn-auto-orphans"
,
Opt_WarnAutoOrphans
,
nop
),
(
"warn-tabs"
,
Opt_WarnTabs
,
nop
),
(
"warn-type-holes"
,
Opt_WarnTypeHoles
,
nop
),
(
"warn-type
d
-holes"
,
Opt_WarnType
d
Holes
,
nop
),
(
"warn-unrecognised-pragmas"
,
Opt_WarnUnrecognisedPragmas
,
nop
),
(
"warn-lazy-unlifted-bindings"
,
Opt_WarnLazyUnliftedBindings
,
\
_
->
deprecate
"it has no effect, and will be removed in GHC 7.10"
),
...
...
@@ -2990,7 +2990,7 @@ standardWarnings
Opt_WarnWarningsDeprecations
,
Opt_WarnDeprecatedFlags
,
Opt_WarnAMP
,
Opt_WarnTypeHoles
,
Opt_WarnType
d
Holes
,
Opt_WarnUnrecognisedPragmas
,
Opt_WarnPointlessPragmas
,
Opt_WarnDuplicateConstraints
,
...
...
compiler/rename/RnExpr.lhs
View file @
778b48af
...
...
@@ -104,7 +104,7 @@ finishHsVar name
rnExpr (HsVar v)
= do { mb_name <- lookupOccRn_maybe v
; case mb_name of {
Nothing -> do { opt_TypeHoles <- woptM Opt_WarnTypeHoles
Nothing -> do { opt_TypeHoles <- woptM Opt_WarnType
d
Holes
; if opt_TypeHoles && startsWithUnderscore (rdrNameOcc v)
then return (HsUnboundVar v, emptyFVs)
else do { n <- reportUnboundName v; finishHsVar n } } ;
...
...
@@ -313,7 +313,7 @@ Since all the symbols are reservedops we can simply reject them.
We return a (bogus) EWildPat in each case.
\begin{code}
rnExpr e@EWildPat = do { holes <- woptM Opt_WarnTypeHoles
rnExpr e@EWildPat = do { holes <- woptM Opt_WarnType
d
Holes
; if holes
then return (hsHoleExpr, emptyFVs)
else patSynErr e
...
...
docs/users_guide/7.8.1-notes.xml
View file @
778b48af
...
...
@@ -19,13 +19,13 @@
<listitem>
<para>
By default, GHC has a new warning enabled,
<literal>
-fwarn-type-holes
</literal>
, which causes the
<literal>
-fwarn-type
d
-holes
</literal>
, which causes the
compiler to respond with the types of unbound
variables it encounters in the source code. (It is
reminiscient of the "holes" feature in languages such
as Agda.)
For more information, see
<xref
linkend=
"type-holes"
/>
.
For more information, see
<xref
linkend=
"type
d
-holes"
/>
.
</para>
</listitem>
...
...
docs/users_guide/flags.xml
View file @
778b48af
...
...
@@ -1522,10 +1522,10 @@
</row>
<row>
<entry><option>
-fwarn-type-holes
</option></entry>
<entry>
Enable
<link
linkend=
"type-holes"
>
holes
</link>
in expressions.
</entry>
<entry><option>
-fwarn-type
d
-holes
</option></entry>
<entry>
Enable
<link
linkend=
"type
d
-holes"
>
holes
</link>
in expressions.
</entry>
<entry>
dynamic
</entry>
<entry><option>
-fno-warn-type-holes
</option></entry>
<entry><option>
-fno-warn-type
d
-holes
</option></entry>
</row>
</tbody>
...
...
docs/users_guide/glasgow_exts.xml
View file @
778b48af
...
...
@@ -7671,14 +7671,14 @@ with <option>-XNoMonoLocalBinds</option> but type inference becomes less predica
</sect1>
<!-- ==================== End of type system extensions ================= -->
<sect1
id=
"type-holes"
>
<sect1
id=
"type
d
-holes"
>
<title>
Type Holes
</title>
<para>
Type hole support is enabled with the option
<option>
-fwarn-type-holes
</option>
, which is enabled by default.
</para>
<option>
-fwarn-type
d
-holes
</option>
, which is enabled by default.
</para>
<para>
The goal of the type holes
extension
is not to change the type system, but to help with writing Haskell
The goal of the type holes
warning
is not to change the type system, but to help with writing Haskell
code. Type holes can be used to obtain extra information from the type checker, which might otherwise be hard
to get.
Normally, the type checker is used to decide if a module is well typed or not. Using GHCi,
...
...
docs/users_guide/using.xml
View file @
778b48af
...
...
@@ -1094,9 +1094,9 @@ test.hs:(5,4)-(6,7):
<variablelist>
<varlistentry>
<term><option>
-fwarn-type-holes
</option>
:
</term>
<term><option>
-fwarn-type
d
-holes
</option>
:
</term>
<listitem>
<indexterm><primary><option>
-fwarn-type-holes
</option></primary>
<indexterm><primary><option>
-fwarn-type
d
-holes
</option></primary>
</indexterm>
<indexterm><primary>
warnings
</primary></indexterm>
<para>
When the compiler encounters an unbound local
...
...
@@ -1106,7 +1106,7 @@ test.hs:(5,4)-(6,7):
includes the type it needs to type check. It works
particularly well with
<link
linkend=
"defer-type-errors"
>
deferred type errors
</link>
.
See
<xref
linkend=
"type-holes"
/></para>
See
<xref
linkend=
"type
d
-holes"
/></para>
<para>
This warning is on by default.
</para>
</listitem>
...
...
testsuite/tests/module/mod71.hs
View file @
778b48af
{-# OPTIONS_GHC -fno-warn-type-holes #-}
{-# OPTIONS_GHC -fno-warn-type
d
-holes #-}
-- !!! Illegal _ in expression
module
M
where
f
x
=
x
_
1
testsuite/tests/rename/should_fail/rnfail016.hs
View file @
778b48af
{-# OPTIONS_GHC -fno-warn-type-holes #-}
{-# OPTIONS_GHC -fno-warn-type
d
-holes #-}
module
ShouldFail
where
-- !!! Pattern syntax in expressions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment