It should check the Key not the ValueType of the TypeAArray to be a template parameter.
Here is a test case for that.

```d
void foo(size_t dim)(int[dim]) { pragma(msg, dim); }

void bar()
{
    int[2] sarr;
    foo(sarr[0 .. 2]);
}
```

Fixed
```c
                Type *tpi;
                if (tb->ty == Tsarray ||
                    tb->ty == Taarray && (tbi = ((TypeAArray *)tb)->index)->ty == Tident &&
                                         ((TypeIdentifier *)tbi)->idents.dim == 0)
```