Check for cyclic class definitions
Summary:
Reimplement the check for cyclic class definitions using the linearization for shallow_class_decl.
Currently, when we encounter a cyclic definition in Decl_linearize, we simply ignore it (otherwise there is no way to return a finite linearization!). This makes it difficult to detect a cyclic definition solely from looking at the linearization.
After this change, when Decl_linearize detects a cyclic definition, it emits an MRO element with the mro_cyclic option set, containing the names of classes involved in the dependency cycle.
Differential Revision:
D15167011
fbshipit-source-id:
961c90260f4419ec9a4ca4427d14dbaa5f7b87eb