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,e12ee9b0877029b2,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-10 17:34:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!np0.iij.ad.jp!news.iij.ad.jp!news01.iij4u.or.jp!not-for-mail From: Andrew Hoddinott Newsgroups: comp.lang.ada Subject: Disagreement between GNAT and Cohen? Date: Tue, 11 Jun 2002 09:33:49 +0900 Organization: Internet Initiative Japan Inc., Tokyo, JAPAN Message-ID: <3D05456D.7050001@golter.demon.co.uk> NNTP-Posting-Host: h032.p997.iij4u.or.jp Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: news01.iij4u.or.jp 1023755630 1480 210.138.229.32 (11 Jun 2002 00:33:49 GMT) X-Complaints-To: news@iij.ad.jp NNTP-Posting-Date: 11 Jun 2002 00:33:49 GMT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ja-JP; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: ja Xref: archiver1.google.com comp.lang.ada:25714 Date: 2002-06-11T00:33:49+00:00 List-Id: With the declaration package Test is type Set_Type is array (1 .. 3) of Boolean; -- for example function Union (Set_1, Set_2 : Set_Type) return Set_Type; end Test; the following code package body Test is function Union (Set_1, Set_2 : Set_Type) return Set_Type is begin return Set_1 or Set_2; end Union; end Test; compiles without problem, but for package body Test is function Union (Set_1, Set_2 : Set_Type) return Set_Type renames "or"; end Test; GNAT (3.14p) gives an error: test.adb:2:04: not subtype conformant with declaration in package Standard test.adb:2:04: return type does not match test.adb:3:15: subprogram used in renaming_as_body cannot be intrinsic This kind of renaming is explicitly used by Cohen in a generics example in section 15.2.3.2 of "Ada as a second language". (Cohen's full example doesn't compile either, although only the first 2 lines of the error message are generated). Am I missing something obvious here? Or is Cohen wrong? Or GNAT? Is there something in the RM that supports GNAT's claim that "subprogram used in renaming_as_body cannot be intrinsic"?