detect cyclic type rules when resolving type rules