[GHC] #15043: Expand type synonym

GHC ghc-devs at haskell.org
Mon Apr 16 15:08:17 UTC 2018


#15043: Expand type synonym
-------------------------------------+-------------------------------------
        Reporter:  domenkozar        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.2.2
  checker)                           |
      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 RyanGlScott):

 Is that the entirety of the error message? I ask because if I try using
 `-fprint-expanded-synonyms` on a smaller program, such as this one:

 {{{#!hs
 module Bug where

 type Foo = Int

 f :: Maybe Foo
 f = Just 'a'
 }}}

 I get this:

 {{{
 $ ghc Bug.hs -fprint-expanded-synonyms
 [1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

 Bug.hs:6:5: error:
     • Couldn't match type ‘Char’ with ‘Int’
       Expected type: Maybe Foo
         Actual type: Maybe Char
       Type synonyms expanded:
       Expected type: Maybe Int
         Actual type: Maybe Char
     • In the expression: Just 'a'
       In an equation for ‘f’: f = Just 'a'
   |
 6 | f = Just 'a'
   |     ^^^^^^^^
 }}}

 Notice that there is a separate `Type synonyms expanded` section which
 shows `Maybe Int` instead of `Maybe Foo`. Does GHC not show this in your
 example?

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15043#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list