Commit c05fddde authored by elaforge's avatar elaforge Committed by Ben Gamari

Rearrange error msgs and add section markers (Trac #11014).

This puts the "Relevant bindings" section at the end.

It uses a TcErrors.Report Monoid to divide messages by importance and
then mappends them together.  This is not the most efficient way since
there are various intermediate Reports and list appends, but it probably
doesn't matter since error messages shouldn't get that large, and are
usually prepended.  In practice, everything is `important` except
`relevantBindings`, which is `supplementary`.

ErrMsg's errMsgShortDoc and errMsgExtraInfo were extracted into ErrDoc,
which has important, context, and suppelementary fields.  Each of those
three sections is marked with a bullet character, '•' on unicode
terminals and '*' on ascii terminals.  Since this breaks tons of tests,
I also modified testlib.normalise_errmsg to strip out '•'s.

--- Additional notes:

To avoid prepending * to an empty doc, I needed to filter empty docs.
This seemed less error-prone than trying to modify everyone who produces
SDoc to instead produce Maybe SDoc.  So I added `Outputable.isEmpty`.
Unfortunately it needs a DynFlags, which is kind of bogus, but otherwise
I think I'd need another Empty case for SDoc, and then it couldn't be a
newtype any more.

ErrMsg's errMsgShortString is only used by the Show instance, which is
in turn only used by Show HscTypes.SourceError, which is in turn only
needed for the Exception instance.  So it's probably possible to get rid
of errMsgShortString, but that would a be an unrelated cleanup.

Fixes #11014.

Test Plan: see above

Reviewers: austin, simonpj, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: simonpj, nomeata, thomie

Differential Revision: https://phabricator.haskell.org/D1427

GHC Trac Issues: #11014
parent f09f2470
......@@ -25,7 +25,7 @@ import Util
import DynFlags
import FastString
import Outputable
import Outputable hiding ( isEmpty )
import qualified Data.Set as Set
import Control.Monad.Fix
import Data.Array as Array
......
......@@ -10,14 +10,15 @@ module ErrUtils (
MsgDoc,
Validity(..), andValid, allValid, isValid, getInvalids,
ErrMsg, WarnMsg, Severity(..),
ErrMsg, ErrDoc, errDoc, WarnMsg, Severity(..),
Messages, ErrorMessages, WarningMessages,
errMsgSpan, errMsgContext, errMsgShortDoc, errMsgExtraInfo,
errMsgSpan, errMsgContext,
mkLocMessage, pprMessageBag, pprErrMsgBagWithLoc,
pprLocErrMsg, makeIntoWarning,
errorsFound, emptyMessages, isEmptyMessages,
mkErrMsg, mkPlainErrMsg, mkLongErrMsg, mkWarnMsg, mkPlainWarnMsg,
mkErrMsg, mkPlainErrMsg, mkErrDoc, mkLongErrMsg, mkWarnMsg,
mkPlainWarnMsg,
printBagOfErrors,
warnIsErrorMsg, mkLongWarnMsg,
......@@ -94,13 +95,28 @@ type ErrorMessages = Bag ErrMsg
data ErrMsg = ErrMsg {
errMsgSpan :: SrcSpan,
errMsgContext :: PrintUnqualified,
errMsgShortDoc :: MsgDoc, -- errMsgShort* should always
errMsgShortString :: String, -- contain the same text
errMsgExtraInfo :: MsgDoc,
errMsgDoc :: ErrDoc,
-- | This has the same text as errDocImportant . errMsgDoc.
errMsgShortString :: String,
errMsgSeverity :: Severity
}
-- The SrcSpan is used for sorting errors into line-number order
-- | Categorise error msgs by their importance. This is so each section can
-- be rendered visually distinct. See Note [Error report] for where these come
-- from.
data ErrDoc = ErrDoc {
-- | Primary error msg.
errDocImportant :: [MsgDoc],
-- | Context e.g. \"In the second argument of ...\".
_errDocContext :: [MsgDoc],
-- | Supplementary information, e.g. \"Relevant bindings include ...\".
_errDocSupplementary :: [MsgDoc]
}
errDoc :: [MsgDoc] -> [MsgDoc] -> [MsgDoc] -> ErrDoc
errDoc = ErrDoc
type WarnMsg = ErrMsg
data Severity
......@@ -156,13 +172,17 @@ makeIntoWarning err = err { errMsgSeverity = SevWarning }
-- -----------------------------------------------------------------------------
-- Collecting up messages for later ordering and printing.
mk_err_msg :: DynFlags -> Severity -> SrcSpan -> PrintUnqualified -> MsgDoc -> SDoc -> ErrMsg
mk_err_msg dflags sev locn print_unqual msg extra
= ErrMsg { errMsgSpan = locn, errMsgContext = print_unqual
, errMsgShortDoc = msg , errMsgShortString = showSDoc dflags msg
, errMsgExtraInfo = extra
mk_err_msg :: DynFlags -> Severity -> SrcSpan -> PrintUnqualified -> ErrDoc -> ErrMsg
mk_err_msg dflags sev locn print_unqual doc
= ErrMsg { errMsgSpan = locn
, errMsgContext = print_unqual
, errMsgDoc = doc
, errMsgShortString = showSDoc dflags (vcat (errDocImportant doc))
, errMsgSeverity = sev }
mkErrDoc :: DynFlags -> SrcSpan -> PrintUnqualified -> ErrDoc -> ErrMsg
mkErrDoc dflags = mk_err_msg dflags SevError
mkLongErrMsg, mkLongWarnMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> MsgDoc -> ErrMsg
-- A long (multi-line) error message
mkErrMsg, mkWarnMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgDoc -> ErrMsg
......@@ -170,12 +190,12 @@ mkErrMsg, mkWarnMsg :: DynFlags -> SrcSpan -> PrintUnqualified -> MsgD
mkPlainErrMsg, mkPlainWarnMsg :: DynFlags -> SrcSpan -> MsgDoc -> ErrMsg
-- Variant that doesn't care about qualified/unqualified names
mkLongErrMsg dflags locn unqual msg extra = mk_err_msg dflags SevError locn unqual msg extra
mkErrMsg dflags locn unqual msg = mk_err_msg dflags SevError locn unqual msg empty
mkPlainErrMsg dflags locn msg = mk_err_msg dflags SevError locn alwaysQualify msg empty
mkLongWarnMsg dflags locn unqual msg extra = mk_err_msg dflags SevWarning locn unqual msg extra
mkWarnMsg dflags locn unqual msg = mk_err_msg dflags SevWarning locn unqual msg empty
mkPlainWarnMsg dflags locn msg = mk_err_msg dflags SevWarning locn alwaysQualify msg empty
mkLongErrMsg dflags locn unqual msg extra = mk_err_msg dflags SevError locn unqual (ErrDoc [msg] [] [extra])
mkErrMsg dflags locn unqual msg = mk_err_msg dflags SevError locn unqual (ErrDoc [msg] [] [])
mkPlainErrMsg dflags locn msg = mk_err_msg dflags SevError locn alwaysQualify (ErrDoc [msg] [] [])
mkLongWarnMsg dflags locn unqual msg extra = mk_err_msg dflags SevWarning locn unqual (ErrDoc [msg] [] [extra])
mkWarnMsg dflags locn unqual msg = mk_err_msg dflags SevWarning locn unqual (ErrDoc [msg] [] [])
mkPlainWarnMsg dflags locn msg = mk_err_msg dflags SevWarning locn alwaysQualify (ErrDoc [msg] [] [])
----------------
emptyMessages :: Messages
......@@ -194,34 +214,42 @@ errorsFound _dflags (_warns, errs) = not (isEmptyBag errs)
printBagOfErrors :: DynFlags -> Bag ErrMsg -> IO ()
printBagOfErrors dflags bag_of_errors
= sequence_ [ let style = mkErrStyle dflags unqual
in log_action dflags dflags sev s style (d $$ e)
in log_action dflags dflags sev s style (formatErrDoc dflags doc)
| ErrMsg { errMsgSpan = s,
errMsgShortDoc = d,
errMsgDoc = doc,
errMsgSeverity = sev,
errMsgExtraInfo = e,
errMsgContext = unqual } <- sortMsgBag (Just dflags)
bag_of_errors
]
bag_of_errors ]
formatErrDoc :: DynFlags -> ErrDoc -> SDoc
formatErrDoc dflags (ErrDoc important context supplementary)
= case msgs of
[msg] -> vcat msg
_ -> vcat $ map starred msgs
where
msgs = filter (not . null) $ map (filter (not . Outputable.isEmpty dflags))
[important, context, supplementary]
starred = (bullet<+>) . vcat
bullet = text $ if DynFlags.useUnicode dflags then "•" else "*"
pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc]
pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag Nothing bag ]
pprLocErrMsg :: ErrMsg -> SDoc
pprLocErrMsg (ErrMsg { errMsgSpan = s
, errMsgShortDoc = d
, errMsgExtraInfo = e
, errMsgDoc = doc
, errMsgSeverity = sev
, errMsgContext = unqual })
= sdocWithDynFlags $ \dflags ->
withPprStyle (mkErrStyle dflags unqual) $
mkLocMessage sev s (d $$ e)
mkLocMessage sev s (formatErrDoc dflags doc)
sortMsgBag :: Maybe DynFlags -> Bag ErrMsg -> [ErrMsg]
sortMsgBag dflags = sortBy (maybeFlip $ comparing errMsgSpan) . bagToList
where maybeFlip :: (a -> a -> b) -> (a -> a -> b)
maybeFlip
| fromMaybe False (fmap reverseErrors dflags) = flip
| otherwise = id
| otherwise = id
ghcExit :: DynFlags -> Int -> IO ()
ghcExit dflags val
......
This diff is collapsed.
......@@ -753,6 +753,12 @@ mkLongErrAt loc msg extra
printer <- getPrintUnqualified dflags ;
return $ mkLongErrMsg dflags loc printer msg extra }
mkErrDocAt :: SrcSpan -> ErrDoc -> TcRn ErrMsg
mkErrDocAt loc errDoc
= do { dflags <- getDynFlags ;
printer <- getPrintUnqualified dflags ;
return $ mkErrDoc dflags loc printer errDoc }
addLongErrAt :: SrcSpan -> MsgDoc -> MsgDoc -> TcRn ()
addLongErrAt loc msg extra = mkLongErrAt loc msg extra >>= reportError
......@@ -769,7 +775,7 @@ reportError err
reportWarning :: ErrMsg -> TcRn ()
reportWarning err
= do { let warn = makeIntoWarning err
-- 'err' was build by mkLongErrMsg or something like that,
-- 'err' was built by mkLongErrMsg or something like that,
-- so it's of error severity. For a warning we downgrade
-- its severity to SevWarning
......@@ -1099,7 +1105,7 @@ mkErrInfo env ctxts
= go 0 env ctxts
where
go :: Int -> TidyEnv -> [ErrCtxt] -> TcM SDoc
go _ _ [] = return Outputable.empty
go _ _ [] = return empty
go n env ((is_landmark, ctxt) : ctxts)
| is_landmark || n < mAX_CONTEXTS -- Too verbose || opt_PprStyle_Debug
= do { (env', msg) <- ctxt env
......
......@@ -19,7 +19,7 @@ module Outputable (
docToSDoc,
interppSP, interpp'SP,
pprQuotedList, pprWithCommas, quotedListWithOr, quotedListWithNor,
empty, nest,
empty, isEmpty, nest,
char,
text, ftext, ptext, ztext,
int, intWithCommas, integer, float, double, rational,
......@@ -301,8 +301,8 @@ pprDeeper d = SDoc $ \ctx -> case ctx of
runSDoc d ctx{sdocStyle = PprUser q (PartWay (n-1))}
_ -> runSDoc d ctx
-- | Truncate a list that is longer than the current depth.
pprDeeperList :: ([SDoc] -> SDoc) -> [SDoc] -> SDoc
-- Truncate a list that list that is longer than the current depth
pprDeeperList f ds
| null ds = f []
| otherwise = SDoc work
......@@ -462,6 +462,10 @@ irrelevantNCols :: Int
-- Used for OneLineMode and LeftMode when number of cols isn't used
irrelevantNCols = 1
isEmpty :: DynFlags -> SDoc -> Bool
isEmpty dflags sdoc = Pretty.isEmpty $ runSDoc sdoc dummySDocContext
where dummySDocContext = initSDocContext dflags PprDebug
docToSDoc :: Doc -> SDoc
docToSDoc d = SDoc (\_ -> d)
......
# coding=utf8
#
# (c) Simon Marlow 2002
#
......@@ -1547,7 +1548,8 @@ def check_stderr_ok(name, way):
return compare_outputs(way, 'stderr',
join_normalisers(norm, getTestOpts().extra_errmsg_normaliser), \
expected_stderr_file, actual_stderr_file)
expected_stderr_file, actual_stderr_file,
whitespace_normaliser=normalise_whitespace)
def dump_stderr( name ):
print("Stderr:")
......@@ -1692,8 +1694,7 @@ def compare_outputs(way, kind, normaliser, expected_file, actual_file,
def normalise_whitespace( str ):
# Merge contiguous whitespace characters into a single space.
str = re.sub('[ \t\n]+', ' ', str)
return str.strip()
return ' '.join(w for w in str.split())
def normalise_callstacks(str):
def repl(matches):
......@@ -1722,6 +1723,11 @@ def normalise_errmsg( str ):
str = re.sub('ghc-stage[123]', 'ghc', str)
# Error messages simetimes contain integer implementation package
str = re.sub('integer-(gmp|simple)-[0-9.]+', 'integer-<IMPL>-<VERSION>', str)
# Also filter out bullet characters. This is because bullets are used to
# separate error sections, and tests shouldn't be sensitive to how the
# the division happens.
bullet = u'•'.encode('utf8')
str = str.replace(bullet, '')
return str
# normalise a .prof file, so that we can reasonably compare it against
......
......@@ -5,12 +5,12 @@ T5380.hs:7:27:
the type signature for:
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:6:10
In the expression: b
In the expression: proc () -> if b then f -< () else f -< ()
Relevant bindings include
b :: not_bool (bound at T5380.hs:7:7)
testB :: not_bool -> (() -> ()) -> () -> not_unit
(bound at T5380.hs:7:1)
In the expression: b
In the expression: proc () -> if b then f -< () else f -< ()
T5380.hs:7:34:
Couldn't match type ‘not_unit’ with ‘()’
......@@ -20,8 +20,8 @@ T5380.hs:7:34:
at T5380.hs:6:10
Expected type: () -> not_unit
Actual type: () -> ()
In the expression: f
In the command: f -< ()
Relevant bindings include
testB :: not_bool -> (() -> ()) -> () -> not_unit
(bound at T5380.hs:7:1)
In the expression: f
In the command: f -< ()
T2507.hs:5:7: error:
Couldn't match expected type `Int' with actual type `()'
In the expression: ()
In an equation for `foo': foo = ()
* Couldn't match expected type `Int' with actual type `()'
* In the expression: ()
In an equation for `foo': foo = ()
T6037.hs:5:7:
Couldn't match expected type `Int' with actual type `()'
In the expression: ()
In an equation for `f?o': f?o = ()
* Couldn't match expected type `Int' with actual type `()'
* In the expression: ()
In an equation for `f?o': f?o = ()
T8959a.hs:5:7: error:
Couldn't match expected type `Int -> Int' with actual type `()'
In the expression: ()
In an equation for `foo': foo = ()
* Couldn't match expected type `Int -> Int' with actual type `()'
* In the expression: ()
In an equation for `foo': foo = ()
......@@ -7,10 +7,10 @@ T3169.hs:13:22:
at T3169.hs:12:3
Expected type: Map a (Map b elt)
Actual type: Map (a, b) elt
In the second argument of ‘lookup’, namely ‘m’
In the expression: lookup a m :: Maybe (Map b elt)
Relevant bindings include
m :: Map (a, b) elt (bound at T3169.hs:12:17)
b :: b (bound at T3169.hs:12:13)
lookup :: (a, b) -> Map (a, b) elt -> Maybe elt
(bound at T3169.hs:12:3)
In the second argument of ‘lookup’, namely ‘m’
In the expression: lookup a m :: Maybe (Map b elt)
......@@ -7,7 +7,7 @@ T7558.hs:8:4:
a pattern with constructor:
MkT :: forall a b. (a ~ Maybe b) => a -> Maybe b -> T a b,
in an equation for ‘f’
Relevant bindings include
f :: T a a -> Bool (bound at T7558.hs:8:1)
In the pattern: MkT x y
In an equation for ‘f’: f (MkT x y) = [x, y] `seq` True
Relevant bindings include
f :: T a a -> Bool (bound at T7558.hs:8:1)
......@@ -11,7 +11,7 @@ gadt-escape1.hs:19:58:
Possible fix: add a type signature for ‘weird1’
Expected type: t
Actual type: ExpGADT t1
Relevant bindings include
weird1 :: t (bound at gadt-escape1.hs:19:1)
In the expression: a
In a case alternative: Hidden (ExpInt _) a -> a
Relevant bindings include
weird1 :: t (bound at gadt-escape1.hs:19:1)
......@@ -10,7 +10,7 @@ gadt13.hs:15:13:
‘t’ is a rigid type variable bound by
the inferred type of shw :: Term t1 -> t at gadt13.hs:15:1
Possible fix: add a type signature for ‘shw’
Relevant bindings include
shw :: Term t1 -> t (bound at gadt13.hs:15:1)
In the expression: ("I " ++) . shows t
In an equation for ‘shw’: shw (I t) = ("I " ++) . shows t
Relevant bindings include
shw :: Term t1 -> t (bound at gadt13.hs:15:1)
......@@ -11,9 +11,9 @@ gadt7.hs:16:38:
‘t’ is a rigid type variable bound by
the inferred type of i1b :: T t1 -> r -> t at gadt7.hs:16:1
Possible fix: add a type signature for ‘i1b’
In the expression: y1
In a case alternative: K -> y1
Relevant bindings include
y1 :: r (bound at gadt7.hs:16:16)
y :: r (bound at gadt7.hs:16:7)
i1b :: T t1 -> r -> t (bound at gadt7.hs:16:1)
In the expression: y1
In a case alternative: K -> y1
......@@ -4,13 +4,13 @@ rw.hs:14:47:
‘a’ is a rigid type variable bound by
the type signature for: writeInt :: T a -> IORef a -> IO ()
at rw.hs:12:12
In the second argument of ‘writeIORef’, namely ‘(1 :: Int)’
In the expression: writeIORef ref (1 :: Int)
In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
Relevant bindings include
ref :: IORef a (bound at rw.hs:13:12)
v :: T a (bound at rw.hs:13:10)
writeInt :: T a -> IORef a -> IO () (bound at rw.hs:13:1)
In the second argument of ‘writeIORef’, namely ‘(1 :: Int)’
In the expression: writeIORef ref (1 :: Int)
In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
rw.hs:19:51:
Couldn't match type ‘a’ with ‘Bool’
......@@ -19,9 +19,9 @@ rw.hs:19:51:
at rw.hs:16:12
Expected type: a -> Bool
Actual type: Bool -> Bool
In the second argument of ‘(.)’, namely ‘not’
In the second argument of ‘(>>=)’, namely ‘(print . not)’
Relevant bindings include
ref :: IORef a (bound at rw.hs:17:12)
v :: T a (bound at rw.hs:17:10)
readBool :: T a -> IORef a -> IO () (bound at rw.hs:17:1)
In the second argument of ‘(.)’, namely ‘not’
In the second argument of ‘(>>=)’, namely ‘(print . not)’
......@@ -33,12 +33,12 @@
../../typecheck/should_run/Defer01.hs:31:5: warning:
Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
Relevant bindings include
f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
The function ‘e’ is applied to one argument,
but its type ‘Char’ has none
In the expression: e 'q'
In an equation for ‘f’: f = e 'q'
Relevant bindings include
f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
../../typecheck/should_run/Defer01.hs:34:8: warning:
Couldn't match expected type ‘Char’ with actual type ‘a’
......@@ -46,20 +46,20 @@
the type signature for:
h :: a -> (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
In the expression: x
In the expression: (x, 'c')
Relevant bindings include
x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
h :: a -> (Char, Char)
(bound at ../../typecheck/should_run/Defer01.hs:34:1)
In the expression: x
In the expression: (x, 'c')
../../typecheck/should_run/Defer01.hs:39:17: warning:
Couldn't match expected type ‘Bool’ with actual type ‘T a’
In the first argument of ‘not’, namely ‘(K a)’
In the expression: (not (K a))
Relevant bindings include
a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
i :: a -> () (bound at ../../typecheck/should_run/Defer01.hs:39:1)
In the first argument of ‘not’, namely ‘(K a)’
In the expression: (not (K a))
../../typecheck/should_run/Defer01.hs:43:5: warning:
No instance for (MyClass a1) arising from a use of ‘myOp’
......@@ -147,12 +147,12 @@
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:31:5: error:
Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
Relevant bindings include
f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
The function ‘e’ is applied to one argument,
but its type ‘Char’ has none
In the expression: e 'q'
In an equation for ‘f’: f = e 'q'
Relevant bindings include
f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:34:8: error:
Couldn't match expected type ‘Char’ with actual type ‘a’
......@@ -160,20 +160,20 @@
the type signature for:
h :: a -> (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
In the expression: x
In the expression: (x, 'c')
Relevant bindings include
x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
h :: a -> (Char, Char)
(bound at ../../typecheck/should_run/Defer01.hs:34:1)
In the expression: x
In the expression: (x, 'c')
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:39:17: error:
Couldn't match expected type ‘Bool’ with actual type ‘T a’
In the first argument of ‘not’, namely ‘(K a)’
In the expression: (not (K a))
Relevant bindings include
a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
i :: a -> () (bound at ../../typecheck/should_run/Defer01.hs:39:1)
In the first argument of ‘not’, namely ‘(K a)’
In the expression: (not (K a))
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:43:5: error:
No instance for (MyClass a1) arising from a use of ‘myOp’
......
......@@ -4,10 +4,10 @@
with actual type ‘a’
‘a’ is a rigid type variable bound by
the instance declaration at <interactive>:5:10
In the expression: a
In the expression: [a, b]
Relevant bindings include
b :: a (bound at <interactive>:5:43)
a :: a (bound at <interactive>:5:41)
asList :: (a, a) -> [ListableElem (a, a)]
(bound at <interactive>:5:33)
In the expression: a
In the expression: [a, b]
......@@ -5,19 +5,16 @@ PushedInAsGivens.hs:10:31:
This (rigid, skolem) type variable is bound by
the type signature for: foo :: (F Int ~ [a1]) => a1 -> Int
at PushedInAsGivens.hs:9:20-44
In the expression: y
In the first argument of ‘length’, namely ‘[x, y]’
Relevant bindings include
x :: a1 (bound at PushedInAsGivens.hs:10:17)
foo :: a1 -> Int (bound at PushedInAsGivens.hs:10:13)
y :: a (bound at PushedInAsGivens.hs:9:5)
bar :: a -> (a, Int) (bound at PushedInAsGivens.hs:9:1)
In the expression: y
In the first argument of ‘length’, namely ‘[x, y]’
PushedInAsGivens.hs:11:15:
Couldn't match expected type ‘[a]’ with actual type ‘F Int’
Relevant bindings include
y :: a (bound at PushedInAsGivens.hs:9:5)
bar :: a -> (a, Int) (bound at PushedInAsGivens.hs:9:1)
In the expression: foo y
In the expression: (y, foo y)
In the expression:
......@@ -25,3 +22,6 @@ PushedInAsGivens.hs:11:15:
foo :: (F Int ~ [a]) => a -> Int
foo x = length [...]
in (y, foo y)
Relevant bindings include
y :: a (bound at PushedInAsGivens.hs:9:5)
bar :: a -> (a, Int) (bound at PushedInAsGivens.hs:9:1)
......@@ -16,9 +16,9 @@ T3208b.hs:15:15:
fce' :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a -> c
at T3208b.hs:14:9-56
The type variable ‘o0’ is ambiguous
Relevant bindings include
f :: a (bound at T3208b.hs:15:6)
fce' :: a -> c (bound at T3208b.hs:15:1)
In the first argument of ‘fce’, namely ‘(apply f)’
In the expression: fce (apply f)
In an equation for ‘fce'’: fce' f = fce (apply f)
Relevant bindings include
f :: a (bound at T3208b.hs:15:6)
fce' :: a -> c (bound at T3208b.hs:15:1)
ExtraTcsUntch.hs:23:18: error:
Couldn't match expected type ‘F Int’ with actual type ‘[[t]]’
Relevant bindings include
x :: [t] (bound at ExtraTcsUntch.hs:21:3)
f :: [t] -> ((), ((), ())) (bound at ExtraTcsUntch.hs:21:1)
In the first argument of ‘h’, namely ‘[x]’
In the expression: h [x]
In an equation for ‘g1’: g1 _ = h [x]
ExtraTcsUntch.hs:25:38: error:
Couldn't match expected type ‘F Int’ with actual type ‘[[t]]’
Relevant bindings include
x :: [t] (bound at ExtraTcsUntch.hs:21:3)
f :: [t] -> ((), ((), ())) (bound at ExtraTcsUntch.hs:21:1)
ExtraTcsUntch.hs:25:38: error:
Couldn't match expected type ‘F Int’ with actual type ‘[[t]]’
In the first argument of ‘h’, namely ‘[[undefined]]’
In the expression: h [[undefined]]
In the expression: (h [[undefined]], op x [y])
Relevant bindings include
x :: [t] (bound at ExtraTcsUntch.hs:21:3)
f :: [t] -> ((), ((), ())) (bound at ExtraTcsUntch.hs:21:1)
......@@ -7,8 +7,8 @@ GADTwrong1.hs:12:21:
at GADTwrong1.hs:12:14
‘b’ is a rigid type variable bound by
the type signature for: coerce :: a -> b at GADTwrong1.hs:10:20
In the expression: y
In a case alternative: T y -> y
Relevant bindings include
y :: c (bound at GADTwrong1.hs:12:16)
coerce :: a -> b (bound at GADTwrong1.hs:11:1)
In the expression: y
In a case alternative: T y -> y
Overlap10.hs:10:7:
Couldn't match expected type ‘F a Bool’ with actual type ‘Bool’
In the expression: False
In an equation for ‘g’: g x = False
Relevant bindings include
x :: a (bound at Overlap10.hs:10:3)
g :: a -> F a Bool (bound at Overlap10.hs:10:1)
In the expression: False
In an equation for ‘g’: g x = False
Overlap11.hs:10:8:
Couldn't match expected type ‘F a Int’ with actual type ‘Int’
In the expression: (5 :: Int)
In an equation for ‘g’: g x = (5 :: Int)
Relevant bindings include
x :: a (bound at Overlap11.hs:10:3)
g :: a -> F a Int (bound at Overlap11.hs:10:1)
In the expression: (5 :: Int)
In an equation for ‘g’: g x = (5 :: Int)
Overlap15.hs:16:9:
Couldn't match expected type ‘F b [b] Bool’ with actual type ‘Bool’
Relevant bindings include
foo :: Proxy b -> F b [b] Bool (bound at Overlap15.hs:16:1)
In the expression: False
In an equation for ‘foo’: foo _ = False
Relevant bindings include
foo :: Proxy b -> F b [b] Bool (bound at Overlap15.hs:16:1)
......@@ -6,8 +6,8 @@ Overlap6.hs:15:7:
at Overlap6.hs:14:6
Expected type: Proxy (And x 'True)
Actual type: Proxy x
In the expression: x
In an equation for ‘g’: g x = x
Relevant bindings include
x :: Proxy x (bound at Overlap6.hs:15:3)
g :: Proxy x -> Proxy (And x 'True) (bound at Overlap6.hs:15:1)
In the expression: x
In an equation for ‘g’: g x = x
Overlap9.hs:10:7:
Couldn't match expected type ‘F a’ with actual type ‘Int’
In the expression: length (show x)
In an equation for ‘g’: g x = length (show x)
Relevant bindings include
x :: a (bound at Overlap9.hs:10:3)
g :: a -> F a (bound at Overlap9.hs:10:1)
In the expression: length (show x)
In an equation for ‘g’: g x = length (show x)
......@@ -2,8 +2,8 @@
SimpleFail16.hs:10:12:
Couldn't match expected type ‘p0 a0’ with actual type ‘F ()’
The type variables ‘p0’, ‘a0’ are ambiguous
Relevant bindings include
bar :: p0 a0 (bound at SimpleFail16.hs:10:1)
In the first argument of ‘foo’, namely ‘(undefined :: F ())’
In the expression: foo (undefined :: F ())
In an equation for ‘bar’: bar = foo (undefined :: F ())
Relevant bindings include
bar :: p0 a0 (bound at SimpleFail16.hs:10:1)
......@@ -6,7 +6,7 @@ SimpleFail5a.hs:31:11:
at SimpleFail5a.hs:30:14
Expected type: S3 a
Actual type: S3 Int
Relevant bindings include
bar3wrong :: S3 a -> a (bound at SimpleFail5a.hs:31:1)
In the pattern: D3Int
In an equation for ‘bar3wrong’: bar3wrong D3Int = 1
Relevant bindings include
bar3wrong :: S3 a -> a (bound at SimpleFail5a.hs:31:1)
......@@ -5,10 +5,10 @@ T2544.hs:17:18: error:
The type variable ‘i0’ is ambiguous
Expected type: IxMap l [Int]
Actual type: IxMap i0 [Int]
Relevant bindings include
empty :: IxMap (l :|: r) [Int] (bound at T2544.hs:17:4)