Fix stack overflow when trying to convert an object of a given type such that the type has static properties of the same type