Raise error when a trait is <<__ConsistentConstruct>> but does not declare an explicit constructor
Summary:
Trait method copy-paste behavior breaks down with ConsistentConstruct, where unlike classes, traits to not generate a pure default constructor. This leads to a bug where a trait method can call `new static()` and assume the constructor is pure when it is really impure in the class that uses the trait.
This diff adds a flag to raise an error when a trait is <<__ConsistentConstruct>> without an explicit constructor. If the trait does have a constructor, then it's okay because the class that uses the trait will be forced to be consistent.
For the sake of completeness, I've added an option to raise this error on *all* classish declarations that do not explicitly declare a constructor, as the consistency is really more of a property of the constructor than of the classish.
Reviewed By: jamesjwu
Differential Revision:
D32151766
fbshipit-source-id:
74fc75b64316286b66678707dccb471564546b90