I understand the rationale of seq[Animal] being a different type than seq[Cat]. 
But I believe this is counter-intuitive when Cat it is actually an animal.

In fact, it looks strange to me the following behaviour:
    
    
    type
      Animal = ref object of RootObj
      Cat = ref object of Animal
    
    
    proc example1(x: Animal) =
      echo "meaw"
    
    let kitty = Cat()
    example1(kitty)     #<---Works
    
    proc example2(x:seq[Animal]) =
      echo "meaws"
    
    let kitties = @[Cat(), Cat()]
    example2(kitties)     #<---Doesn't work
    
    Run

Reply via email to