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

#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

#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

#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

#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

#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

#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

#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

#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

#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

#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
participants (1)
-
GHC