That is not a simple type. And people who still remember the original Pascal will know that you do not want to encourage people to make the size part of the collection type. And it doesn't buy you much if you cannot prove at compile time that the type you use to index into the collecton cannot overflow the collection bounds. Use Ada if you need that.
func bar() [10]foo
with
var a [8]foo = bar
giving an error like
cannot use bar() (type [10]foo) as type [8]foo in assignment
Is it necessary to use Peano arithmetic to specify a simple type in a general purpose programming language?