Shouldn't both be static arrays? `dim` is not a type.