--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: gnat: Rejects matching parameter in generic instantiation as non-matching
- From: Jacob Sparre Andersen <sparre@nbi.dk>
- Date: Wed, 22 Jun 2005 16:00:47 +0200
- Message-id: <E1Dl5mZ-0004Sh-R1@hugin.crs4.it>
Package: gnat
Version: 3.15p-12
Severity: normal
The included code example is rejected with the following error message:
-----
gnatgcc -c -O0 -gnatE -gnato -gnatv -gnatv -gnati1 -gnatf -gnato -fstack-check demo.adb
GNAT 3.15p (20020523) Copyright 1992-2002 Free Software Foundation, Inc.
Compiling: demo.adb (source file time stamp: 2005-06-22 13:44:20)
16. Measurement_Array => Measurement_Array);
|
>>> component subtype of actual does not match that of formal "Measurement_Array"
>>> instantiation abandoned
20 lines: 2 errors
gnatmake: "demo.adb" compilation error
-----
To the best of my knowledge this program is legal Ada.
------------------------------------------------------------------------------
-- Source code:
with Generic_Root;
with Generic_Root.Child;
procedure Demo is
type Scalar is digits 15;
package Measurements is
new Generic_Root (Scalar => Scalar);
type Measurement_Array is array (Positive range <>)
of Measurements.Measurement;
package Measurement_Text_IO is
new Measurements.Child (Indices => Positive,
Measurement_Array => Measurement_Array);
begin
null;
end Demo;
generic
type Scalar is digits <>;
package Generic_Root is
---------------------------------------------------------------------------
-- type Limit:
type Limit is (Below, Exact, Above, Undefined);
---------------------------------------------------------------------------
-- type Measurement:
type Measurement (As : Limit := Exact) is
record
case As is
when Below | Exact | Above =>
Value : Scalar;
when Undefined =>
null;
end case;
end record;
---------------------------------------------------------------------------
end Generic_Root;
with Ada.Text_IO;
generic
type Indices is (<>);
type Measurement_Array is array (Indices range <>) of Measurement;
package Generic_Root.Child is
end Generic_Root.Child;
------------------------------------------------------------------------------
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-powerpc
Locale: LANG=fo_FO.ISO8859-1, LC_CTYPE=fo_FO.ISO8859-1 (charmap=ISO-8859-1)
Versions of packages gnat depends on:
ii binutils 2.15-7 The GNU assembler, linker and bina
ii libc6 2.3.2.ds1-22 GNU C Library: Shared libraries an
ii libc6-dev 2.3.2.ds1-22 GNU C Library: Development Librari
ii libgnat-3.15p-1 3.15p-12 The GNU Ada 95 compiler runtime li
Versions of packages gnat recommends:
ii ada-reference-ma 20021112web-3 The standard describing the Ada 95
ii gnat-gdb 5.3.gnat.0.0.20030225-8 Ada-aware version of GDB
ii gnat-gps 2.1.0-4 The GNAT Programming System - adva
-- no debconf information
--- End Message ---