It works if you convert the first element explicitly.
    
    
    type
      Parent = ref object of RootObj
        i: int
      Child = ref object of Parent
        f: float
    
    let list: seq[Parent] = @[Parent(Child()), Child(), Child()]
    
    echo list[0][]
    
    
    Run

It's just another form of the following problem:
    
    
    let
      s1: seq[int32] = @[1, 2, 3] #error
      s2: seq[int32] = @[int32(1), 2, 3] #works
    
    
    Run

Reply via email to