GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:40:41Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9371Overlapping type families, segafult2019-07-07T18:40:41ZpinguOverlapping type families, segafultNot entirely sure what's going on here. I don't think this should type check; it appears to segfault whilst calling show on the wrong type.
This is probably not the absolute minimum required to reproduce.
I have reproduced on 7.8.3 and...Not entirely sure what's going on here. I don't think this should type check; it appears to segfault whilst calling show on the wrong type.
This is probably not the absolute minimum required to reproduce.
I have reproduced on 7.8.3 and 7.9.20140727.
```haskell
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE OverlappingInstances #-}
import Data.Monoid
class C x where
data D x :: *
makeD :: D x
instance Monoid x => C x where
data D x = D1 (Either x ())
makeD = D1 (Left mempty)
instance (Monoid x, Monoid y) => C (x, y) where
data D (x,y) = D2 (x,y)
makeD = D2 (mempty, mempty)
instance Show x => Show (D x) where
show (D1 x) = show x
main = print (makeD :: D (String, String))
```
This does not segfault if you add:
```haskell
instance (Show x, Show y) => Show (D (x,y)) where
show (D2 x) = show x
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Overlapping type families, segafult","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.3","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Not entirely sure what's going on here. I don't think this should type check; it appears to segfault whilst calling show on the wrong type.\r\n\r\nThis is probably not the absolute minimum required to reproduce.\r\n\r\nI have reproduced on 7.8.3 and 7.9.20140727.\r\n\r\n{{{#!haskell\r\n{-# LANGUAGE TypeFamilies #-}\r\n{-# LANGUAGE FlexibleInstances #-}\r\n{-# LANGUAGE UndecidableInstances #-}\r\n{-# LANGUAGE OverlappingInstances #-}\r\nimport Data.Monoid\r\n\r\nclass C x where\r\n data D x :: *\r\n makeD :: D x\r\n\r\ninstance Monoid x => C x where\r\n data D x = D1 (Either x ())\r\n makeD = D1 (Left mempty)\r\n\r\ninstance (Monoid x, Monoid y) => C (x, y) where\r\n data D (x,y) = D2 (x,y)\r\n makeD = D2 (mempty, mempty)\r\n\r\ninstance Show x => Show (D x) where\r\n show (D1 x) = show x\r\n\r\n\r\nmain = print (makeD :: D (String, String))\r\n}}}\r\n\r\nThis does not segfault if you add:\r\n\r\n{{{#!haskell\r\n instance (Show x, Show y) => Show (D (x,y)) where\r\n show (D2 x) = show x\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.8.4Richard Eisenbergrae@richarde.devRichard Eisenbergrae@richarde.dev