comp.lang.ada
 help / color / mirror / Atom feed
From: Charly <carl.weierstrass@googlemail.com>
Subject: bug or feature
Date: Sun, 7 Sep 2014 03:33:19 -0700 (PDT)
Date: 2014-09-07T03:33:19-07:00	[thread overview]
Message-ID: <136dc796-8f60-4fc0-a2f8-70e0ca24c9f1@googlegroups.com> (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

 


             reply	other threads:[~2014-09-07 10:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 10:33 Charly [this message]
2014-09-07 16:59 ` bug or feature 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
replies disabled

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