[GHC] #9173: Better type error messages
GHC
ghc-devs at haskell.org
Thu Jun 29 18:49:16 UTC 2017
#9173: Better type error messages
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
| TypeErrorMessages
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by vanto):
I'm coming back about the solution provided by rwbarton.
This solution is not appropriate in the case below.
{{{
let y = [True, 'a']
}}}
What is the actual type? What is the expected type?\\
If I change the order of the values in the list like this:
{{{
let y = ['a', True]
}}}
What is the actual type? What is the expected type?\\\\
An obvious answer is {{{The types must be identical in a list}}} or {{{The
types are not equal}}}
Here we see that there is no signature. If the signature had been {{{y ::
[Char]}}}
The obvious answer is the one I have given in comment 23, and which is
{{{
The Type of the result is not in accordance with the Type of the signature
}}}
So I no longer agree with rwbarton and bgamari.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9173#comment:27>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list