comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Another OA bug ? (was Re: OA bug ?)
Date: 1999/06/23
Date: 1999-06-23T00:00:00+00:00	[thread overview]
Message-ID: <3770F3E6.51746D0A@averstar.com> (raw)
In-Reply-To: 7knvo6$7kc$1@nnrp1.deja.com

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




      reply	other threads:[~1999-06-23  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-21  0:00 OA bug ? Vladimir Olensky
1999-06-21  0:00 ` Tucker Taft
1999-06-22  0:00   ` Another OA bug ? (was Re: OA bug ?) czgrr
1999-06-23  0:00     ` Tucker Taft [this message]
replies disabled

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