@Martin_fr: You're over-complicating this. The point is simple: I want a 100-element array - I don't want to write [0..99], and I definitely don't want to declare a range type first just to use it. Just write the number. Ok? Old code stays valid. If you want enum/subrange/type as index, you write it explicitly. The shorthand array[N] is for "I just want N elements" - 99% of array declarations.
I didn't plan on making this a discussion, and really hadn't thought that I would give any further reply on this....
But that answer at first glance is really scary. And I think and hope there is a misunderstanding on either of our sides...
I do have the idea what you want to be able to do... And I didn't say any of what I listed should be added.
I said:
But, if you do, then I will still give you bits and pieces that maybe are worth to be considered to find out how you want to exactly specify what it is you do...
I.e. it would be best to deliberately decide what of this should affect the design (and how), and what not. And what might be later of possible interest. And what matters here is the word deliberate. You may well decide to pick exactly what you already had in mind.
Maybe you had already deliberated all of that... Maybe not. For the case that you had not, this was just me pointing it out.
E.g. maybe it really
never matters how "n" is code-completed in the below
type TFoo array [256] of boolean;
var f: TFoo;
begin
f[n {complete n via code tool} ] := true;
Maybe its fine that this will just give integer. Maybe someone suddenly wants that to be byte (but "byte(256)" isn't a thing).
If you deliberately decided that, then you will tell them that whatever it does, it was for good reason (and I don't and didn't judge that in any way).
Giving your coding abilities, I would think that you would agree that even if the result should coincidently be the same, a deliberated choice is still better, than accidentally getting there.
That was my entire point.
And I do not think that this "a deliberate choice" is "over-complicating it" => if indeed as I read (maybe misread?) your reply, you say that this does not matter... Well then that is imho very scary. (with regard to the quality of the result)