Common interfaces for types (accessing instance fields in arrays with objects of different types in it)
Hello,

I came across one case which I believe can be improved in ksy compiler.

So, consider this bit of code. It compiles ok when type is the same in both cases, but if they are not regardless to the fact that `.get_x` returns values of the same type it wont compile producing error.

```
(main): /instances/something/value: called attribute 'get_x' on generic struct expression 'Subscript(Name(identifier(items)),IntNum(0))'
```

Can it be improved? It should be possible to check that all types in cases clause have `.get_x` in there definitions. Would be great if you could share your opinion.

```ksy
meta:
  id: test
  endian: le
  ks-version: 0.7

seq:
  - id: items
    repeat: eos
    type: 
      switch-on: 'items.size % 2'
      cases:
        0: complex_type1        
        1: complex_type2
instances:
  something:
    value: items[0].get_x
types:
   complex_type1:
     seq:
       - id: x
         type: u4
     instances:
       get_x:
         value: x * 2
   complex_type2:
     seq:
       - id: x
         type: u4
     instances:
       get_x:
         value: x * 3

```

