comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Interresting, possibly buggy behavior in GNAT generics w/ expression function.
Date: Fri, 29 Mar 2013 07:47:23 -0700 (PDT)
Date: 2013-03-29T07:47:23-07:00	[thread overview]
Message-ID: <61ece03f-9528-4371-b209-6046f975dc3b@googlegroups.com> (raw)
In-Reply-To: <lysj3eir9b.fsf@pushface.org>

On Friday, March 29, 2013 1:45:04 AM UTC-6, Simon Wright wrote:
> In Generic_Attribute_Set, you have two Image functions:
> 
>     function Image(Value : Attribute_Values) return String
> 
> (Attribute_Values is a generic formal scalar) and
> 
>     function Image(Value : Positive) return String
> 
> and you instantiate the package with Attribute_Values => Integer.
> 
> 
> What happens when you change the second Image's parameter to Integer is
> that GNAT chooses the wrong Image to call!

Yes; hence the 'interesting' and 'possibly buggy'.

> 
> I don't know whether this is a language problem or a GNAT problem. Or,
> of course, a user problem!

This is precisely why I posted it here rather than instantly filing a bug-report.

On the other hand it seems to violate the generic-parameters/principal that we can only apply operations (Attributes and Operations) which the formal is *known* to have. 



  parent reply	other threads:[~2013-03-29 14:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 17:34 Interresting, possibly buggy behavior in GNAT generics w/ expression function Shark8
2013-03-28 18:06 ` Simon Wright
2013-03-28 18:38   ` Shark8
2013-03-30  5:59     ` Stephen Leake
2013-03-30 14:20       ` Shark8
2013-03-29  7:45 ` Simon Wright
2013-03-29 12:27   ` Dmitry A. Kazakov
2013-03-29 14:45     ` Simon Wright
2013-03-29 16:21       ` Dmitry A. Kazakov
2013-03-29 16:43         ` Shark8
2013-03-29 17:43         ` Eryndlia Mavourneen
2013-03-29 17:45           ` Eryndlia Mavourneen
2013-03-29 18:38             ` Simon Wright
2013-03-30  0:56         ` Randy Brukardt
2013-03-30  9:24           ` Dmitry A. Kazakov
2013-04-02  0:52             ` Randy Brukardt
2013-04-02  8:51               ` Dmitry A. Kazakov
2013-04-02 21:59                 ` Randy Brukardt
2013-03-29 14:47   ` Shark8 [this message]
2013-03-29 14:56     ` Shark8
2013-03-30  1:04   ` Randy Brukardt
2013-03-30  2:36     ` Shark8
2013-03-30 15:51     ` Simon Wright
2013-04-01 15:58     ` Adam Beneschan
2013-04-02  0:46       ` Randy Brukardt
2013-04-02  8:18         ` Simon Wright
2013-04-02 11:14         ` Stephen Leake
2013-04-02 22:00           ` Randy Brukardt
2013-04-02 23:01             ` Adam Beneschan
2013-04-04  0:08               ` Randy Brukardt
2013-03-29 14:47 ` Simon Wright
2013-03-29 14:54   ` Shark8
2013-03-29 15:26     ` Bill Findlay
2013-03-29 15:48     ` Simon Wright
replies disabled

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