Skip to content

Looping default associated type family without UndecidableInstances

When I say

{-# LANGUAGE TypeFamilies #-}

module Bug where

import Data.Proxy

class C a where
  type F a
  type F a = F a

instance C Bool

x :: Proxy (F Bool)
x = Proxy

GHC just loops. Setting a low -ftype-function-depth doesn't help. I actually don't terribly mind the looping (although aborting with an overflow would be better). But I don't like that it's possible without UndecidableInstances in sight.

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information