The code below produces ObjectAssignmentError, as far as I understand it's because the sequence defined as seq[Doc] and not as seq[TextDoc].
But aren't such errors supposed to be caught at compile time, by compiler and not leak into runtime?
type
Doc = object of RootObj
TextDoc* = object of Doc
title*: string
text*: string
TodoDoc* = object of Doc
todo*: string
var all_docs*: seq[Doc] = @[]
all_docs.add TextDoc(title: "", text: "")