Skip to content

Type equality class leads to non-termination

This program sends the type checker to the land of no return:

{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}

module ShouldCompile where

class E a b | a -> b, b -> a
instance E a a

plus :: (E a (Int -> Int)) => Int -> a
plus x y = x + y
Trac metadata
Trac field Value
Version 6.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information