If, in the test code on line 842 of ts.ts, we did not add an @serializable annotation, the ModelSchema for PictureTodo would not be instantiated, getOrCreateSchema called from subSchema would return ToDo instead of PictureToDo and the invariant on the very next line would trigger, resulting in an Error: "Can not apply subSchema on a schema not extending another one.".
I think the lazy evaluation is assuming there will be an @serialize annotation on an intermediate subclass (like PictureToDo) which will trigger the createModelSchema call. However, in my use case, I have an intermediate class that does not provide additional properties for serialization.
If, in the test code on line 842 of ts.ts, we did not add an
@serializableannotation, theModelSchemaforPictureTodowould not be instantiated,getOrCreateSchemacalled from subSchema would returnToDoinstead ofPictureToDoand the invariant on the very next line would trigger, resulting in an Error: "Can not apply subSchema on a schema not extending another one.".I think the lazy evaluation is assuming there will be an
@serializeannotation on an intermediate subclass (likePictureToDo) which will trigger thecreateModelSchemacall. However, in my use case, I have an intermediate class that does not provide additional properties for serialization.