[GHC] #12729: Unlifted newtypes via GADTSyntax
 
            #12729: Unlifted newtypes via GADTSyntax -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC accepts Unknown/Multiple | invalid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHC disallows to define a newtype of an unlifted type (`newtype A = A Int#`). However, this restriction is not enforced when the newtype is defined using GADT syntax: {{{ newtype A where A :: Int# -> A }}} For example, I can derive Show for A and on my machine `main = print (A 0#)` segfaults. Tested on GHC 8.0.1 and master. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12729 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
 
            #12729: Unlifted newtypes via GADTSyntax -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): See UnliftedDataTypes ([https://ghc.haskell.org/trac/ghc/wiki/UnliftedDataTypes#Proposal3:Allownewty... Proposal 3: Allow newtypes over unlifted types]) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12729#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
 
            #12729: Unlifted newtypes via GADTSyntax
-------------------------------------+-------------------------------------
        Reporter:  monoidal          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones 
 
            #12729: Unlifted newtypes via GADTSyntax -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T12729 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => typecheck/should_fail/T12729 Comment: Good bug report thanks. Easily fixed. Merge to 8.0. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12729#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
 
            #12729: Unlifted newtypes via GADTSyntax -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T12729 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as 4c8aab8f5663b9f0f1acdcc1afc85d921f2609d6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12729#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
 
            #12729: Unlifted newtypes via GADTSyntax -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC accepts | Test Case: invalid program | typecheck/should_fail/T12729 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.0.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12729#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
- 
                 GHC GHC