[GHC] #15583: Treating Constraint as Type when using (type C = Constraint)

GHC ghc-devs at haskell.org
Thu Aug 30 17:32:50 UTC 2018


#15583: Treating Constraint as Type when using (type C = Constraint)
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.5
      Resolution:  duplicate         |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15412            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 Yep, this is a duplicate of #15412. Now that that's been fixed, you get
 the error message you'd expect on the original program:

 {{{
 $ /opt/ghc/8.6.1/bin/ghci Bug.hs
 GHCi, version 8.6.0.20180823: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Main             ( Bug.hs, interpreted )

 Bug.hs:22:9: error:
     • Couldn't match expected type ‘a -> a’ with actual type ‘()’
     • In the expression: ()
       In an equation for ‘id_’: id_ = ()
       In the instance declaration for ‘Category_ (->)’
     • Relevant bindings include id_ :: a -> a (bound at Bug.hs:22:3)
    |
 22 |   id_ = ()
    |         ^^
 }}}

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


More information about the ghc-tickets mailing list