Open RiscadoA opened 1 year ago
Maybe also relevant for EnumTrait
(#579)
Maybe also relevant for
EnumTrait
(#579)
We previously discussed a partial solution to this problem which doesn't cover the EnumTrait
scenario, which was checking if the size of the type we're reflecting actually makes sense considering the fields we're reflecting. In retrospective, that isn't a good approach as we possibly want to avoid reflecting some fields anyway. But yeah, that solution wasn't perfect anyway.
Problem
It hasn't happened yet but it seems that someone adding a new field to a reflectable type and forgetting to add it to the trait will be a common problem. It will probably will be hard to debug, at least in the near future.
In a more distant future, it probably won't be that bad for game devs using our engine, as they would probably notice quickly that the new field isn't saved to scene files and won't appear on the editor.
Solution
We could have a CI action to check that this isn't violated, or extend clang-tidy to do so.