From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3b05b1b1a4c14d,start X-Google-Attributes: gid103376,public From: Ken Garlington Subject: "Selected Component" problem with GNAT Date: 1996/11/15 Message-ID: <328C6C42.3D73@lmtas.lmco.com>#1/1 X-Deja-AN: 196702415 to: report@gnat.com content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.02 (Macintosh; I; 68K) Date: 1996-11-15T00:00:00+00:00 List-Id: 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