compiler chrashes with "Run time error, rule 'equalize_atypes_attributes' in module 'overloading' does not match"

This is the minimal code for which the problem occurs:

:: T a = T

class C a b where
    x :: a -> b

instance C (T b) b where
    x _ = undef

f = g h

g :: a -> () | C a String
g _ = ()

h :: T a
h = undef

If Int is used instead of String in the signature of g, the problem does not occur.