[GHC] #12094: Unlifted types and pattern synonym signatures

GHC ghc-devs at haskell.org
Sat May 21 03:46:32 UTC 2016


#12094: Unlifted types and pattern synonym signatures
-------------------------------------+-------------------------------------
           Reporter:  akio           |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
  (Type checker)                     |
           Keywords:  pattern        |  Operating System:  Unknown/Multiple
  synonyms                           |
       Architecture:                 |   Type of failure:  GHC rejects
  Unknown/Multiple                   |  valid program
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The following program is rejected by ghc-8.0.1:

 {{{#!hs
 {-# LANGUAGE MagicHash #-}
 {-# LANGUAGE PatternSynonyms #-}
 module Foo where

 import GHC.Exts (Int#)

 pattern Zero :: Int# -- commenting out this line works
 pattern Zero <- 0#
 }}}

 {{{
 % ghc-stage2 unlifted-pattern-synonym.hs
 [1 of 1] Compiling Foo              ( unlifted-pattern-synonym.hs,
 unlifted-pattern-synonym.o )

 unlifted-pattern-synonym.hs:7:17: error:
     • Expecting a lifted type, but ‘Int#’ is unlifted
     • In the type ‘Int#’
 }}}

 Commenting out the type signature removes the error.

 GHC 7.10.3 accepts this program, with and without the type signature.

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


More information about the ghc-tickets mailing list