Why is it impossible to subtype a struct?

I might not been seen it right, but something like this would save me some code.

I have a satellite simulator that I put in a package inside a compiled system image so that other people can use it easily. This simulator let you define the controller and the estimator. Each one has they own abstract type, so that the user can modify the default.

Every time the satellite changes the mode, the controller is different. In some very long simulations that take 2 to 3 hours, it would be bad if something fails because the new controller does not implement all the necessary properties. Hence, I need to programmatically check if everything is right before the beginning of the simulation. If we have such a feature, then the code would not even compile.

Anyway, maybe my approach is wrong and there are better ways to do that, but for my use case now, it will be very nice :slight_smile:

2 Likes