cubesatlab / cubedos

A flight software framework in SPARK/Ada
48 stars 5 forks source link

Range constraints should allow 'First to be used when defining the lower bound of a range #55

Open pchapin opened 3 months ago

pchapin commented 3 months ago

Currently it is possible to use 'Last to specify the upper bound of a range based on some other type's upper bound like this:

typedef int T1 range 1 .. 10;
typedef int T2 range 5 .. T1'Last;

However, the following does not work, and probably should for symmetry if nothing else (not to mention it might be useful):

typedef int T1 range 1 .. 10;
typedef int T2 range T1'First .. 5;

Currently Mercury only allows the lower bound of a range to be a constant, not any form of identifier.