Given the following three models:
class SourceOperator: SyncOperator { ... }
class RestSourceOperator: SourceOperator { ... }
class BatchOperator: AggregateOperator { let sources = List<SourceOperator>() ... }
After instantiating a RestSourceOperator which inherits from SourceOperator and attempt to append it to the BatchOperator instance the application crashes with:
Terminating app due to uncaught exception ‘RLMException’, reason: 'Object of type ‘RestSourceOperator’ does not match RLMArray type ‘SourceOperator’.'
I’d like to avoid hacking around our domain model, any suggestions around handling this exception and helping persist a RestSourceOperator while still extending the base class?