Commit bb7f2308 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Comments only

parent 18cd7124
......@@ -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
......@@ -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"
module T11541 where
g :: Ord k => k -> v -> ()
g k v = ()
f x y =
let m = min x y
in g m foo
T11541.hs:8:12: error: Variable not in scope: foo
......@@ -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, [''])
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment