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,bfa3bd0e1081a777 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Another OA bug ? (was Re: OA bug ?) Date: 1999/06/23 Message-ID: <3770F3E6.51746D0A@averstar.com>#1/1 X-Deja-AN: 492963063 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <929984465.815.34@news.remarQ.com> <376EA582.418CEDC3@averstar.com> <7knvo6$7kc$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-23T00:00:00+00:00 List-Id: czgrr wrote: > > Hi, all. > > Is there also a fix going for this bug. I did email > adasupport@aonix.com but never got a reply... The example code is ambiguous. The bug is in the error reporting of ambiguity when you have user-defined operators. There is not a fix yet (but there is now a PTR assigned ;-). > -- > -- SOURCE CODE. > -- OPTION 1: Uncomment only line 1 of main procedure. > -- OPTION 2: Uncomment only line 2 of main procedure. > -- > PROCEDURE main IS > > TYPE a_type IS DIGITS 15 ; > TYPE b_type IS DIGITS 15 ; > > a : a_type ; > b : b_type := 1.0 ; > > FUNCTION "*" ( l : IN a_type ; r : IN b_type ) RETURN b_type IS > BEGIN > RETURN 0.0 ; > END ; > > FUNCTION "/" ( l, r : IN b_type ) RETURN a_type IS > BEGIN > RETURN 0.0 ; > END ; > > BEGIN > -- a := 1.0 * b / 1.0 ; > -- a := 1.0 * b_type'( 1.0 ) / 1.0 ; Both of these are ambiguous, because the "*" can be either the predefined "b_type * b_type => b_type" or the user-defined "a_type * b_type => b_type". If you disambiguate the type of the first "1.0" via "a_type'(1.0)" or "b_type'(1.0)" it will compile successfully. > > END main ; > > -- > -- COMPILER VERSION. > -- > -- ObjectAda for Windows > -- V7.1.1.352 (professional edition) > -- > -- Achieved by installing CD labelled "PRO71" (Version 7.1) > -- Followed by CD labelled "OAOPE71" (OpenPack), > -- Followed by CD labelled "OA711" (Version 7.1.1 Update, Ref: > A1102.7.1.1). > > -- > -- COMPILER OUTPUT. > -- > > -- OPTION 1: > --------------------Target: Win32 (Intel) Debug-------------------- > -- Assertion failed: subtype_is_scalar(scalar_subtype) || > (subtype_is_private(scalar_subtype) && (subtype_ili_slot(scalar_subtype) > >0)), file \\efreeti\d-drive\adamagic\src\ccomp\subtype.c, line 8599 > -- > -- abnormal program termination > -- main.ada: Internal: line 25 col 22 Fatal internal assertion failure. > -- > -- Tool execution failed. > > -- OPTION 2: > --------------------Target: Win32 (Intel) Debug-------------------- > -- Assertion failed: value!=NULL_UR_PTR, file \\efreeti\d- > drive\adamagic\src\ccomp\tree_build.c, line 2733 > -- > -- abnormal program termination > -- main.ada: Internal: line 26 col 35 Fatal internal assertion failure. > -- > -- Tool execution failed. > > Cheers, > czgrr -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA