Skip to content

Segfault when showing (undefined :: Type)

This comment made me wonder about the relationship between Void and Type, id :: Void -> Void and id :: Type -> Type:

#11311 (closed)?replyto=3##11442 (closed)

{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-

import Data.Kind (Type)

instance Show Type where
  show _ = "..."

main = print (undefined :: Type)

running gives:

$ runghc --version
runghc 8.1.20160113
$ runghc -ignore-dot-ghci Segfault.hs 
Segmentation fault (core dumped)

Verbose log attached.

Edited by Icelandjack
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information