[GHC] #8762: Panic involving unboxed tuples and phantom types

#8762: Panic involving unboxed tuples and phantom types ------------------------------------+------------------------------------- Reporter: josef | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- I ran into a bug involving unboxed tuples and the following piece of code is an attempt at isolating the problem: {{{ {-# LANGUAGE UnboxedTuples #-} module Main where type Ty a = Int bug :: Ty a -> (# Ty a, () #) bug ty = (# ty, () #) main = do let (# a, b #) = bug undefined return () }}} It seems that the phantom type is necessary to trigger the bug. The bug is still present in 7.8rc1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8762 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8762: Panic involving unboxed tuples and phantom types -------------------------------------+------------------------------------ Reporter: josef | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * version: 7.6.3 => 7.8.1-rc1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8762#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8762: Panic involving unboxed tuples and phantom types -------------------------------------+------------------------------------ Reporter: josef | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * milestone: => 7.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8762#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8762: Panic involving unboxed tuples and phantom types -------------------------------------+------------------------------------ Reporter: josef | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by goldfire): I just took a look at this and ended up in deeper waters within the type- checker than where I feel comfortable. But I did discover that the bug persists with {{{ {-# LANGUAGE UnboxedTuples #-} module Bug where data Ty a = Int bug :: () -> (# Ty a, () #) bug _ = (# Int, () #) main :: IO () main = do let (# a, b #) = bug () return () }}} Note that there is no `undefined`, and the previous type synonym `Ty` has now become a datatype. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8762#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8762: Panic involving unboxed tuples and phantom types
-------------------------------------+------------------------------------
Reporter: josef | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.8.1-rc1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Simon Peyton Jones

#8762: Panic involving unboxed tuples and phantom types -------------------------------------------------+------------------------- Reporter: josef | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: Resolution: | 7.8.1-rc1 Operating System: Unknown/Multiple | Keywords: Type of failure: None/Unknown | Architecture: Test Case: | Unknown/Multiple typecheck/should_compile/T8762 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by simonpj): * status: new => merge * testcase: => typecheck/should_compile/T8762 Comment: Fixed, thank you. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8762#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8762: Panic involving unboxed tuples and phantom types -------------------------------------------------+------------------------- Reporter: josef | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: 7.8.1 Resolution: fixed | Version: Operating System: Unknown/Multiple | 7.8.1-rc1 Type of failure: None/Unknown | Keywords: Test Case: | Architecture: typecheck/should_compile/T8762 | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8762#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC