[GHC] #14325: Erroneous program emits no errors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[GHC] #14325: Erroneous program emits no errors

GHC - devs mailing list
#14325: Erroneous program emits no errors
-------------------------------------+-------------------------------------
           Reporter:  simonpj        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Consider this (which arose in #14323):
 {{{
 class (a~b) => C a b

 foo :: C a b => a -> b
 foo x = x

 hm3 :: C (f b) b => b -> f b
 hm3 x = foo x
 }}}
 With GHC 8.2 it compiles without error, but it definitely has a type
 error; try `-ddump-simpl`:
 {{{
 hm3 :: forall (f :: * -> *) b. C (f b) b => b -> f b
 [GblId, Arity=2, Str=<L,U><L,U>x]
 hm3
   = \ (@ (f_a126 :: * -> *))
       (@ b_a127)
       ($dC_a129 :: C (f_a126 b_a127) b_a127)
       _ [Occ=Dead] ->
       case GHC.Types.HEq_sc
              @ *
              @ *
              @ (f_a126 b_a127)
              @ b_a127
              ($dC_a129
               `cast` ((T14323.N:C[0] ; Data.Type.Equality.N:~[0]
                                            <*>_N) <f_a126 b_a127>_N
 <b_a127>_N
                       :: (C (f_a126 b_a127) b_a127 :: Constraint)
                          ~R# ((f_a126 b_a127 :: *) ~~ (b_a127 :: *) ::
 Constraint)))
       of cobox_a12p
       { __DEFAULT ->
       case Control.Exception.Base.typeError
              @ 'GHC.Types.LiftedRep
              @ (C b_a127 (f_a126 b_a127))
              "T14323.hs:28:9: error:\n\
              \    \\226\\128\\162 Could not deduce (C b (f b)) arising
 from a use of \\226\\128\\152foo\\226\\128\\153\n\
              \      from the context: C (f b) b\n\
              \        bound by the type signature for:\n\
              \                   hm3 :: forall (f :: * -> *) b. C (f b) b
 => b -> f b\n\
              \        at T14323.hs:27:1-28\n\
              \    \\226\\128\\162 In the expression: foo x\n\
              \      In an equation for \\226\\128\\152hm3\\226\\128\\153:
 hm3 x = foo x\n\
              \(deferred type error)"#
       of wild_00 {
       }
       }
 }}}
 Reason: bug in the error suppression logic in `TcErrors`

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #14325: Erroneous program emits no errors

GHC - devs mailing list
#14325: Erroneous program emits no errors
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      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 Simon Peyton Jones <simonpj@…>):

 In [changeset:"c81f66ccafdb4c6c7a09cfaf6819c8797c518491/ghc"
 c81f66cc/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="c81f66ccafdb4c6c7a09cfaf6819c8797c518491"
 Fix over-eager error suppression in TcErrors

 See Note [Given insolubles] in TcRnTypes

 Fixes Trac #14325.
 }}}

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #14325: Erroneous program emits no errors

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#14325: Erroneous program emits no errors
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  merge
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  typecheck/should_fail/T14325
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * testcase:   => typecheck/should_fail/T14325
 * status:  new => merge


Comment:

 Merge if convenient.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets