Check for cycles in types, constants