comp.lang.ada
 help / color / mirror / Atom feed
* Static bounds of loop - compilation error
@ 2012-10-30 13:26 pascal.malaise
  2012-10-30 14:37 ` Georg Bauhaus
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: pascal.malaise @ 2012-10-30 13:26 UTC (permalink / raw)


Hi Ada experts,

can anyone explain the following compilation errors:
procedure T is
  type E is (A, B, C);
  subtype S is E range A .. B;
  X, Y : S;
begin
  X := A;
  Y := B;
  for I in S range X .. Y loop
    case I is
      when A => null;
      when B => null;
    end case;
  end loop;
end T;
>> missing case value: "C"

A similar example where S is a subtype of Positive leads to the same  error and also: bounds of "I" are not static, alternatives must cover base type

Indeed, X and Y are not static but the bounds of S are, and all the values of S are covered in the "case".

So is it a bug?

Thank you



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-31 16:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30 13:26 Static bounds of loop - compilation error pascal.malaise
2012-10-30 14:37 ` Georg Bauhaus
2012-10-30 16:10 ` Adam Beneschan
2012-10-30 17:03   ` Yannick Duchêne (Hibou57)
2012-10-30 17:15     ` Yannick Duchêne (Hibou57)
2012-10-31 13:18       ` Marc C
2012-10-31 16:23 ` pascal.malaise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox