So I'm working on a little project, and I came upon a problem, I broke down the
problem to illustrate what my problem is roughly.
type
A = object of RootObj
x: int
B = object of A
y: int
X = object
values: seq[A]
var myX = X(values: @[])
myX.values.add B(x:0, y:5)
Run
This sort of code always gets the 'Invalid Object assignment' error. Even when
I try to clarify that B is acceptable with
myX.values.add(A B(x:0, y:0))
Run
I still get this error. What is going on? Is there a way for me to work around
this? Thanks.