The `if` expression in value instances is not type-checked
Currently I only check `<type>.instances.<instance>.if`, but I have feeling that the same problem exists for other fields where expression is allowed.

Below the comparison between parse instance and value instance. There are many other problems with variables, but in this issue lets focus on missing checks of expression type:

Legend for the **OK?** column:
- :white_check_mark: -- correct behavior, nothing is required. Variable either allowed when should or disallowed when shouldn't.
- :x: -- this variable should be denied in this context, but currently it is allowed at least in some cases.
- :question: -- variable should be allowed in some cases, or error messages are unclear, or some checks are missing. In other words, something should be corrected.


`<type>.instances.<instance>.if` (parse instance)
-------------------------------------------------
[Parsed by `ParseUtils.getOptValueExpression`](https://github.com/kaitai-io/kaitai_struct_compiler/blob/8610e1d7a796aad7addb64a5be2f9da48289bffc/shared/src/main/scala/io/kaitai/struct/format/AttrSpec.scala#L180).

Test KSY:
```yaml
meta:
  id: test_type
  endian:
    switch-on: 1
    cases:
      1: be
      2: le
params:
  - id: param
    type: u1
seq:
  - id: seq
    type: u1
instances:
  me:
    size: 1
    if: {} # Substitution place for the variable
  instance:
    value: 1
```

|OK?|Variable|Current status|Comment|
|---|--------|--------------|-------|
|:white_check_mark:|`param`[^5]   |Allowed| |
|:question:|`seq`[^2]     |Allowed|If `seq` depends from `me`, then should be denied (currently it is allowed and we get error in runtime)|
|:question:|`instance`[^3]|Allowed|Analogous to `seq`|
|:x:|`me`[^6]      |Allowed|Check is performed before the field will be read. Access to the self getter is generated which leads to infinity recursion|
|:white_check_mark:|`unknown`[^4] |Denied |Error reported: `unable to access 'unknown' in <type name> context`. In is better to enclose `<type name>` in quotes|
|:question:|`_`           |Denied |Error reported: `java.util.NoSuchElementException: None.get`|
|:white_check_mark:|`_buf`        |Denied |Error reported: `invalid ID: '\_buf', expected /^[a-z][a-z0-9_]*$/`|
|:x:|`_index`      |Allowed|Access to the undefined loop variable is generated (`i` in JS). Must be denied, because condition is checked before the loop, so even with `repeat` using this variable has no sense|
|:white_check_mark:|`_io`         |Allowed| |
|:question:|`_is_le`      |Denied |Error reported: `invalid ID: '\_is_le', expected /^[a-z][a-z0-9_]*$/`. If `<type>` supports variable byte order, should be allowed|
|:question:|`_on`         |Denied |Error reported: `java.util.NoSuchElementException: None.get`|
|:white_check_mark:|`_parent`     |Allowed| |
|:white_check_mark:|`_root`       |Allowed| |
|:white_check_mark:|`_sizeof`     |Allowed|Expanded to the compile-time constant of the `<type>`'s size|


`<type>.instances.<instance>.if` (value instance)
-------------------------------------------------
[Parsed by `ParseUtils.getOptValueExpression`](https://github.com/kaitai-io/kaitai_struct_compiler/blob/8610e1d7a796aad7addb64a5be2f9da48289bffc/shared/src/main/scala/io/kaitai/struct/format/InstanceSpec.scala#L67).

Test KSY:
```yaml
meta:
  id: test_type
  endian:
    switch-on: 1
    cases:
      1: be
      2: le
params:
  - id: param
    type: u1
seq:
  - id: seq
    type: u1
instances:
  me:
    value: 1
    if: {} # Substitution place for the variable
  instance:
    value: 1
```

|OK?|Variable|Current status|Comment|
|---|--------|--------------|-------|
|:question:|`param`[^5]   |Allowed|Expression type is not checked|
|:question:|`seq`[^2]     |Allowed|Expression type is not checked. Field dependencies is not checked. Should be denied if `seq` depends of `me`|
|:question:|`instance`[^3]|Allowed|Expression type is not checked. Field dependencies is not checked. Should be denied if `instance` depends of `me`|
|:x:|`me`[^6]      |Allowed|Check is performed before the field will be read. Access to the self getter is generated which leads to infinity recursion|
|:x:|`unknown`[^4] |Allowed|Access to the undefined field is generated (`this.unknown` in JS)|
|:x:|`_`           |Allowed|Access to the undefined local variable is generated (`_` in JS)|
|:x:|`_buf`        |Allowed|Access to the undefined field is generated (`this._buf` in JS)|
|:x:|`_index`      |Allowed|Access to the undefined loop variable is generated (`i` in JS). Must be denied, because condition is checked before the loop, so even with `repeat` using this variable has no sense|
|:question:|`_io`         |Allowed|Expression type is not checked|
|:x:|`_is_le`      |Allowed|Access to the undefined field is generated (`this._isLe` in JS). If `<type>` supports variable byte order, should be translated to check of the right field (`this._is_le` in JS)|
|:x:|`_on`         |Allowed|Access to the undefined local variable is generated (`on` in JS)|
|:question:|`_parent`     |Allowed|Expression type is not checked|
|:question:|`_root`       |Allowed|Expression type is not checked|
|:question:|`_sizeof`     |Allowed|Expression type is not checked. Expanded to the compile-time constant of the `<type>`'s size|


[^2]: attribute of the enclosing type in `seq` section
[^3]: instance of the enclosing type in `instances` section
[^4]: non-existent attribute or instance in the enclosing type
[^5]: parameter of the enclosing type
[^6]: reference to self