[GHC] #11541: Type errors sometimes has a lot of irrelevant information
GHC
ghc-devs at haskell.org
Fri Feb 12 14:13:42 UTC 2016
#11541: Type errors sometimes has a lot of irrelevant information
-------------------------------------+-------------------------------------
Reporter: augustss | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by j.waldmann):
I have seen this behvaiour a few times.
Here is a simple self-contained test case:
{{{
g :: Ord k => k -> v -> ()
g k v = ()
f x y =
let m = min x y
in g m foo
}}}
8-rc2 outputs this:
{{{
ghci C.hs
GHCi, version 8.0.0.20160204: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( C.hs, interpreted )
C.hs:5:11: error:
• No instance for (Ord t) arising from a use of ‘min’
Possible fix:
add (Ord t) to the context of
the inferred type of f :: t -> t -> ()
• In the expression: min x y
In an equation for ‘m’: m = min x y
In the expression: let m = min x y in g m foo
C.hs:6:11: error: Variable not in scope: foo
}}}
The relevant error message (not in scope) comes last, the message before
is bogus.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11541#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list