Skip to content

Type synonyms not expanded consistently in errors

With this module:

type Foo = Int

x :: Char
x = f

f :: Foo
f = 5

GHC says:

g.hs:5:5:
    Couldn't match expected type `Char' with actual type `Int'
    Expected type: Char
      Actual type: Foo
    In the expression: f
    In an equation for `x': x = f

Note that the first line talks about Int, whereas the third line talks about Foo. I'd expect both to talk about Foo.

Trac metadata
Trac field Value
Version 7.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information