Invalid type in `nkWhenStmt`
### Description

The following snippet (from md5.nim):

```nim
template slice(s: string, a, b): openArray[uint8] =
  when nimvm:
    # toOpenArray is not implemented in VM
    var s2 = newSeq[uint8](s.len)
    for i in 0 ..< s2.len:
      s2[i] = uint8(s[i])
    s2
  else:
    s.toOpenArrayByte(a, b)
```

creates an `nkWhenStmt` whose `typ` is `tySequence` which is wrong, specially for the runtime branch (`s` is an `openArray`) - this disturbs the type analysis done in `nlvm` (since it uses `typ` to determine how to load the source.



### Nim Version

2.0.8

### Current Output

_No response_

### Expected Output

_No response_

### Possible Solution

_No response_

### Additional Information

_No response_