From: Adam Beneschan <adam@irvine.com>
Subject: Re: GNAT GPL 2011 bug ?
Date: Tue, 7 Feb 2012 07:50:41 -0800 (PST)
Date: 2012-02-07T07:50:41-08:00 [thread overview]
Message-ID: <a88ad728-36c9-48b6-b301-b4a07c366c73@m5g2000yqk.googlegroups.com> (raw)
In-Reply-To: 4b574ffc-15f2-4c74-878c-1e9884849d1b@eb6g2000vbb.googlegroups.com
On Feb 7, 4:05 am, David <d.combesdhen...@gmail.com> wrote:
> Hi all,
>
> The compiler accept the line mark by a arrow of the adb bellow and
> refuse the line mark by "****". I think it must not accept the first
> line to. What do you think ?
I agree, it's a bug. It shouldn't allow a constant L_I to be passed
as an OUT parameter.
-- Adam
>
> Thanks
>
> ------- ads --------
>
> type I is interface;
>
> procedure set (Self : out I;
> Value : in Natural) is abstract;
>
> type A is abstract tagged null record;
>
> procedure set (Self : out A;
> Value : in Natural) is abstract;
>
> type Implement_I is new I with null record;
>
> overriding procedure set (Self : out Implement_I;
> Value : in Natural) is
> null;
>
> Null_Implement_I : constant Implement_I := Implement_I'(null
> record);
>
> type Implement_A is new A with null record;
>
> overriding procedure set (Self : out Implement_A;
> Value : in Natural) is null;
>
> Null_Implement_A : constant Implement_A := Implement_A'(null
> record);
>
> procedure Test;
>
> --- adb ---
>
> procedure Test
> is
> L_I : constant test.I'Class := Null_Implement_I;
> L_A : constant test.A'Class := Null_Implement_A;
> begin
> L_I.set (Value => 2); <--------
> L_A.set (Value => 2); *******
> end;
next prev parent reply other threads:[~2012-02-07 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 12:05 GNAT GPL 2011 bug ? David
2012-02-07 15:50 ` Adam Beneschan [this message]
2012-02-07 16:01 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox