comp.lang.ada
 help / color / mirror / Atom feed
From: "Maxim Reznik 2147483647" <max1@mbank.com.ua>
Subject: It seems bug in GNAT with overloading in assignment
Date: Mon, 25 Feb 2002 10:59:11 +0200
Date: 2002-02-25T08:58:55+00:00	[thread overview]
Message-ID: <a5cuca$fu8$1@news.kiev.sovam.com> (raw)

Trying to understand overloading rules I wrote a following test.
I would like to see what error compiler reported.
But it didn't report any error. I tried with 3.13p and 3.14p
for Windows.
Then I setup ObjectAda to tried with it. ObjectAda
reported "Ambiguous assignment".
Finally I removed Dummy parameter from function declaration
and gnat crashed with message "GNAT BUG DETECTED"

Here is the test:
------ test.adb
with Ada.Text_IO;

procedure Test is

   type Int_A is new Integer;
   type Int_B is new Integer;

   type Int_A_Ptr is access all Int_A;
   type Int_B_Ptr is access all Int_B;

   function X (Dummy : Integer) return Int_A_Ptr is
   begin
      Ada.Text_IO.Put_Line ("First interpretation");
      return null;
   end X;

   function X (Dummy : Integer) return Int_B_Ptr is
   begin
      Ada.Text_IO.Put_Line ("Second interpretation");
      return null;
   end X;
begin
   X (1).all := 1;  -- Ambiguous assignment
end Test;






             reply	other threads:[~2002-02-25  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-25  8:59 Maxim Reznik 2147483647 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-02-25  9:37 It seems bug in GNAT with overloading in assignment Christoph Grein
replies disabled

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