Kaitai Struct - How to reference object variable from imported ksy file as size
I have an external ksy file specifically designed to hold an "object" in ksy, it holds something called `coffee`, where `coffee` has attributes `identifier`, `length_in_bytes` and `flavor`.

I am importing `coffee` into my main ksy file and wish to use the value `length_in_bytes` as the `size` attribute for another "object" read in through `seq`.

The code below will explain more succinctly what is happening:



> testfile.ksy


```yaml
meta:
  id: testfile
  imports:
    - drinks
  title: testfile
  # additional information here defining file-extension, endian and encoding
  # additional information here defining doc
seq:
  - id: drinksset
    type: drinks
    repeat: expr
    repeat-expr: 2
types:
  drinks:
    seq:
      - id: drinks_listings
        type: coffee
        size: coffee.length_in_bytes
```

> drinks.ksy

```yaml
meta:
  id: coffee
  title: coffee
  # additional information here defining file-extension encoding & endian
  # additional information here defining doc
types:
  coffee:
    seq: 
      - id: identifier
        type: u4
      - id: length_in_bytes
        type: u4
      - id: flavor
        type: u4
```

My issue is with the line: 

```yaml
size: coffee.length_in_bytes
```


 - I know this, because removing this line allows the ksy file to successfully read from the test data file. 

 - When I have the types information for coffee inside `testfile.ksy`, there is **no issue**, it is only when the `coffee` type is imported in a separate file that is has issues. 

 - I am able to read other attributes I may define in `coffee.ksy` without issue, for instance declaring a custom data-type called `u4test` with `type: u4` and referencing that instead of `u4` for `flavor` works fine.



I believe it may be a Kaitai typing issue, and have tried the following:



 - `size: coffee::length_in_bytes`

 - `size: coffee.as<coffee>.length_in_bytes`

 - `size: coffee.as<u4>.length_in_bytes`

 - `size: _parent.coffee.as<coffee>.length_in_bytes`

 - `size: _parent.coffee.as<u4>.length_in_bytes`



But nothing has worked.



Refer [Kaitai.io](http://kaitai.io/)



Thankyou, insight is appreciated.