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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e19a809544945098,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!m3g2000hsc.googlegroups.com!not-for-mail From: echancrure@gmail.com Newsgroups: comp.lang.ada Subject: worrying behaviour Date: Fri, 2 May 2008 08:26:14 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 149.153.23.133 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1209741975 17385 127.0.0.1 (2 May 2008 15:26:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 2 May 2008 15:26:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m3g2000hsc.googlegroups.com; posting-host=149.153.23.133; posting-account=j4uaqAoAAAA5AhxfF2TUYlfYDKlx8cY_ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:21173 Date: 2008-05-02T08:26:14-07:00 List-Id: After the discussion on static expressions etc. I came up against this problem which I thought was initially related to it but probably not. let's say I have: with Ada.Text_IO; use Ada.Text_IO; with ints; procedure static is function "-"(L, R : ints.My_Int) return ints.My_int renames ints."-"; function "-"(L : ints.My_Int) return ints.My_int renames ints."-"; Y : constant ints.My_int := -1; Z : constant ints.My_int := 1-1; begin Put_Line (ints.My_Int'Image (Y) & ints.My_Int'Image (Z)); end static; and package ints is type My_Int is range -100..100; function "-" (L, R : My_Int) return My_int; end ints; package body ints is function "-" (L, R : My_Int) return My_Int is begin return 42; end "-"; end ints; So basically, I have forgotten to define unary "-" in the the ints package. gnat does not complain and the .exe returns '-1 42' as would be expected without the unary - rename. Here however I have renamed the unary - to something that does not exist. Surely an error should be generated here. Otherwise this is very dangerous behaviour. Please enlight me.