From: Ken Garlington <garlingtonke@lmtas.lmco.com>
To: report@gnat.com
Subject: "Selected Component" problem with GNAT
Date: 1996/11/15
Date: 1996-11-15T00:00:00+00:00 [thread overview]
Message-ID: <328C6C42.3D73@lmtas.lmco.com> (raw)
I have the following source code, which compiles, links, and runs OK
on a couple of different Ada 83 compilers (DEC Ada, Tartan):
package Test_Rec is
type A_Record_Type is record
A_Component : Boolean;
end record;
function A_Record return A_Record_Type;
procedure A_Record ( Result : out A_Record_Type );
end Test_Rec;
package body Test_Rec is
function A_Record return A_Record_Type is
begin
return A_Record_Type'(A_Component => True);
end A_Record;
procedure A_Record ( Result : out A_Record_Type ) is
begin
Result := A_Record;
end A_Record;
end Test_Rec;
with Test_Rec;
with Text_IO;
procedure A_Test is
begin
if Test_Rec.A_Record.A_Component then
Text_IO.Put_Line("I knew that!");
end if;
end A_Test;
I received a report that GNAT doesn't like this code. I tried it on
WebAda, and got the following error:
GNAT 3.07 (961007) Copyright 1991-1996 Free Software Foundation, Inc.
Checking: /export/user_data/ada_source/www.lmtas.com/a_test.adb (source
file time stamp: 1996-11-15 19:01:39)
1. with Test_Rec;
2. with Text_IO;
3. procedure A_Test is
4. begin
5. if Test_Rec.A_Record.A_Component then
|
>>> invalid prefix in selected component "A_Record"
6. Text_IO.Put_Line("I knew that!");
7. end if;
8. end A_Test;
9.
9 lines:
Is this a GNAT bug, a bug in the Ada 83 compilers, or something else?
--
LMTAS - "Our Brand Means Quality"
For more info, see http://www.lmtas.com or http://www.lmco.com
next reply other threads:[~1996-11-15 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-11-15 0:00 Ken Garlington [this message]
1996-11-15 0:00 ` "Selected Component" problem with GNAT Robert A Duff
1996-11-20 0:00 ` Robert Dewar
1996-11-22 0:00 ` Ken Garlington
1996-11-25 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox