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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c66d09a3a91fd87f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-25 00:58:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!newsfeed.cwix.com!newsfeed1.cidera.com!Cidera!news2.dg.net.ua!bn.utel.com.ua!carrier.kiev.ua!news.kiev.sovam.com!Svitonline.COM!not-for-mail From: "Maxim Reznik 2147483647" Newsgroups: comp.lang.ada Subject: It seems bug in GNAT with overloading in assignment Date: Mon, 25 Feb 2002 10:59:11 +0200 Organization: Svit Online (post does not reflect views of Golden Telecom) Message-ID: NNTP-Posting-Host: 212.109.37.91 X-Trace: news.kiev.sovam.com 1014627535 16328 212.109.37.91 (25 Feb 2002 08:58:55 GMT) X-Complaints-To: abuse@svitonline.com NNTP-Posting-Date: 25 Feb 2002 08:58:55 GMT X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:20349 Date: 2002-02-25T08:58:55+00:00 List-Id: 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;