[GHC] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

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

[GHC] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
           Reporter:  Remi           |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  low            |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.4.3
  (Type checker)                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:  aarch64        |   Type of failure:  Compile-time
                                     |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 {-# LANGUAGE PatternSynonyms #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 module Oops where

 pattern What = True :: Maybe
 }}}

 Fails on 8.4.3 with:
 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.4.3 for x86_64-unknown-linux):
         isUnliftedType
   (Maybe |> {co_a1Dg3}) :: TYPE t_a1Dg9[tau:1]
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in
 ghc:Outputable
         pprPanic, called at compiler/types/Type.hs:1939:10 in ghc:Type

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 I'm currently cloning from git, and will try to get around to check it
 with HEAD over the next days. BTW, it's not a show-stopper for me.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289>
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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by Remi):

 * architecture:  aarch64 => Unknown/Multiple


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * keywords:   => PatternSynonyms


Comment:

 This also panics on GHC HEAD:

 {{{
 $ /opt/ghc/head/bin/ghc Bug2.hs
 [1 of 1] Compiling Oops             ( Bug2.hs, Bug2.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.5.20180616 for x86_64-unknown-linux):
         isUnliftedType
   (Maybe |> {co_aWy}) :: TYPE t_aWE[tau:0]
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1164:37 in
 ghc:Outputable
         pprPanic, called at compiler/types/Type.hs:1934:10 in ghc:Type
 }}}

 This appears to be a regression from GHC 8.2.2, in which the same program
 simply gives an error message:

 {{{
 $ /opt/ghc/8.2.2/bin/ghc Bug2.hs
 [1 of 1] Compiling Oops             ( Bug2.hs, Bug2.o )

 Bug2.hs:5:16: error:
     • Couldn't match expected type ‘Maybe’ with actual type ‘Bool’
     • In the pattern: True
       In the pattern: True :: Maybe
       In the declaration for pattern synonym ‘What’
   |
 5 | pattern What = True :: Maybe
   |                ^^^^

 Bug2.hs:5:16: error:
     • Couldn't match expected type ‘Maybe’ with actual type ‘Bool’
     • In the expression: True
       In an equation for ‘What’: What = True
   |
 5 | pattern What = True :: Maybe
   |                ^^^^^^^^^^^^^

 Bug2.hs:5:24: error:
     • Expecting one more argument to ‘Maybe’
       Expected a type, but ‘Maybe’ has kind ‘* -> *’
     • In the type ‘Maybe’
       In a pattern type signature: Maybe
       In the pattern: True :: Maybe
   |
 5 | pattern What = True :: Maybe
   |                        ^^^^^
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#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
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * cc: simonpj (added)


Comment:

 This was introduced in commit 594879dcb2fd5421d5f6ce5341442de32a4aac0a
 (`Fix floating of equalities`).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#comment:3>
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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"7b8dcd90c5a622146dfdd3b162a1f1b1d262d5cf/ghc"
 7b8dcd90/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="7b8dcd90c5a622146dfdd3b162a1f1b1d262d5cf"
 testsuite: Add broken test for #15289

 The stderr output is merely a guess at what we should expect, but
 currently this
 is certainly broken.
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#comment:4>
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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"2896082ec79f02b6388e038a8dae6cb22fe72dfc/ghc"
 2896082e/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="2896082ec79f02b6388e038a8dae6cb22fe72dfc"
 Fix error recovery for pattern synonyms

 As Trac #15289 showed, we were carrying on after a type error
 in a pattern synonym, and then crashing.  This patch improves
 error handling for pattern synonyms.

 I also moved a bit of code from TcBinds into TcPatSyn, which
 helpfully narrows the API.
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#comment:5>
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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Simon, is this a merge candidate for 8.6.1?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#comment:6>
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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  merge
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * status:  new => merge


Comment:

 It seems like a simple enough patch and this is clearly a bug so I'm happy
 to merge.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#comment:7>
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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  merge
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Yes, probably worth merging

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#comment:8>
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] #15289: isUnliftedType GHC panic on pattern with True :: Maybe

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#15289: isUnliftedType GHC panic on pattern with True :: Maybe
-------------------------------------+-------------------------------------
        Reporter:  Remi              |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  low               |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.3
  checker)                           |             Keywords:
      Resolution:  fixed             |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * status:  merge => closed
 * resolution:   => fixed


Comment:

 Merged in 149d7912eb84a24861b021c13d2ee61b44de5856.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15289#comment:9>
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