Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
bb7f2308
Commit
bb7f2308
authored
Feb 15, 2016
by
Simon Peyton Jones
Browse files
Comments only
parent
18cd7124
Changes
5
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcErrors.hs
View file @
bb7f2308
...
...
@@ -134,7 +134,12 @@ reportUnsolved wanted
;
getTcEvBinds
binds_var
}
-- | Report *all* unsolved goals as errors, even if -fdefer-type-errors is on
-- However, do not make any evidence bindings, because we don't
-- have any convenient place to put them.
-- See Note [Deferring coercion errors to runtime]
-- Used by solveEqualities for kind equalities
-- (see Note [Fail fast on kind errors] in TcSimplify]
-- and for simplifyDefault.
reportAllUnsolved
::
WantedConstraints
->
TcM
()
reportAllUnsolved
wanted
=
report_unsolved
Nothing
False
TypeError
HoleError
HoleError
wanted
...
...
@@ -240,11 +245,15 @@ data ReportErrCtxt
-- (innermost first)
-- ic_skols and givens are tidied, rest are not
,
cec_tidy
::
TidyEnv
,
cec_binds
::
Maybe
EvBindsVar
-- Nothinng <=> Report all errors, including holes; no bindings
-- Just ev <=> make some errors (depending on cec_defer)
-- into warnings, and emit evidence bindings
-- into 'ev' for unsolved constraints
-- Nothing <=> Report all errors, including holes
-- Do not add any evidence bindings, because
-- we have no convenient place to put them
-- See TcErrors.reportAllUnsolved
-- Just ev <=> make some errors (depending on cec_defer)
-- into warnings, and emit evidence bindings
-- into 'ev' for unsolved constraints
,
cec_errors_as_warns
::
Bool
-- Turn all errors into warnings
-- (except for Holes, which are
...
...
compiler/typecheck/TcSimplify.hs
View file @
bb7f2308
...
...
@@ -188,11 +188,15 @@ defaultCallStacks wanteds
solveEqualities is used to solve kind equalities when kind-checking
user-written types. If solving fails we should fail outright, rather
than just accumulate an error message, for two reasons:
* A kind-bogus type signature may cause a cascade of knock-on
errors if we let it pass
* More seriously, if we don't solve a constraint we'll be left
with a type that has a coercion hole in it, something like
* More seriously, we don't have a convenient term-level place to add
deferred bindings for unsolved kind-equality constraints, so we
don't build evidence bindings (by usine reportAllUnsolved). That
means that we'll be left with with a type that has coercion holes
in it, something like
<type> |> co-hole
where co-hole is not filled in. Eeek! That un-filled-in
hole actually causes GHC to crash with "fvProv falls into a hole"
...
...
testsuite/tests/typecheck/should_fail/T11541.hs
0 → 100644
View file @
bb7f2308
module
T11541
where
g
::
Ord
k
=>
k
->
v
->
()
g
k
v
=
()
f
x
y
=
let
m
=
min
x
y
in
g
m
foo
testsuite/tests/typecheck/should_fail/T11541.stderr
0 → 100644
View file @
bb7f2308
T11541.hs:8:12: error: Variable not in scope: foo
testsuite/tests/typecheck/should_fail/all.T
View file @
bb7f2308
...
...
@@ -406,3 +406,4 @@ test('T11355', normal, compile_fail, [''])
test
('
T11464
',
normal
,
compile_fail
,
[''])
test
('
T11473
',
expect_broken
(
11473
),
compile_fail
,
[''])
test
('
T11563
',
normal
,
compile_fail
,
[''])
test
('
T11541
',
normal
,
compile_fail
,
[''])
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment