comp.lang.ada
 help / color / mirror / Atom feed
* bug or feature
@ 2014-09-07 10:33 Charly
  2014-09-07 16:59 ` Dirk Heinrichs
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Charly @ 2014-09-07 10:33 UTC (permalink / raw)


Hi,

I found the following strange behavior of gnat-gpl-2014 (ubuntu linux amd64) and I wonder, if it is a bug in gnat:

I  habe a package Datum_Pkg that defines a tagged type Datum and Datum_Vector (using Ada.Conainers.Vectors). In the main program I want to iterate over the vector (all irrelevant lines removed):

  1   with Ada.Text_IO;
  2   with Datum_Pkg;
  3  
  4   procedure Main is
  5 
  6      subtype Datum is Datum_Pkg.Datum;
  7      subtype Datum_Vector is Datum_Pkg.Datum_Vectors.Vector;
  8     
  9      D_Vec : Datum_Vector;
 10     
 11   begin
 12   
 13      for Dat : Datum_Pkg.Datum of D_Vec loop
 14         Ada.Text_IO.Put_Line ("Datum=" & Dat.Image);
 15      end loop;
 16      
 17      for Dat : Datum of D_Vec loop
 18         Ada.Text_IO.Put_Line ("Datum=" & Dat.Image);
 19      end loop;   
 20      
 21   end Main;

Line 13 compiles without message but in line 17 I get an error message:
   subtype indication does not match element type
But this line should be equivalent to line 13 because of the subtype definition
in line 6.


Regards
Charly

 


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

end of thread, other threads:[~2014-10-06 17:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-07 10:33 bug or feature Charly
2014-09-07 16:59 ` Dirk Heinrichs
2014-09-08  8:48   ` Stephen Leake
2014-09-08 18:07     ` Charly
2014-09-09  4:32       ` Stephen Leake
2014-09-09  4:39     ` Dirk Heinrichs
2014-09-08  8:51 ` Stephen Leake
2014-09-08  9:09   ` J-P. Rosen
2014-09-08 15:31   ` Adam Beneschan
2014-09-08  9:43 ` Simon Wright
2014-09-09  4:40   ` Stephen Leake
2014-10-06 17:48     ` Simon Wright

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