[GHC] #12522: GHC 8.0.1 hangs, looping forever in type-checker

GHC ghc-devs at haskell.org
Fri Sep 23 03:59:56 UTC 2016


#12522: GHC 8.0.1 hangs, looping forever in type-checker
-------------------------------------+-------------------------------------
        Reporter:  clinton           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by clinton:

@@ -5,3 +5,1 @@
- {-# LANGUAGE TypeFamilyDependencies #-}
- {-# LANGUAGE FlexibleInstances #-}
- {-# LANGUAGE AllowAmbiguousTypes #-}
+     {-# LANGUAGE TypeFamilyDependencies #-}
@@ -9,1 +7,1 @@
- main = return $ f (Just 'c')
+     main = return $ f (Just 'c')
@@ -11,2 +9,2 @@
- data D1 x
- data D2
+     data D1 x
+     data D2
@@ -14,3 +12,3 @@
- type family TF x = t | t -> x
- type instance TF (D1 x, a) = Maybe (TF (x, a))
- type instance TF (D2, ()) = Char
+     type family TF x = t | t -> x
+     type instance TF (D1 x, a) = Maybe (TF (x, a))
+     type instance TF (D2, ()) = Char
@@ -18,2 +16,2 @@
- class C p where
-   f :: TF (x, a) -> ()
+     f :: TF (x, a) -> ()
+     f _ = ()

New description:

 I'm not sure if this is a bug or hanging the compiler is expected here.
 This was the minimal example that causes GHC to hang:

 {{{#!hs
     {-# LANGUAGE TypeFamilyDependencies #-}

     main = return $ f (Just 'c')

     data D1 x
     data D2

     type family TF x = t | t -> x
     type instance TF (D1 x, a) = Maybe (TF (x, a))
     type instance TF (D2, ()) = Char

     f :: TF (x, a) -> ()
     f _ = ()
 }}}

--

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


More information about the ghc-tickets mailing list