comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Basic issue with dotted notation and tagged types
Date: Mon, 22 Oct 2012 13:18:18 +0200
Date: 2012-10-22T13:18:16+02:00	[thread overview]
Message-ID: <50852b78$0$6627$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <23619b66-91a4-4786-b210-8012e648e631@googlegroups.com>

On 22.10.12 12:52, Marius Amado-Alves wrote:
>> RM2005 4.1.3 (9.2/2): "The designator of the subprogram shall not be the
>> same as that of a component of the tagged type visible at the point of
>> the selected_component."
> 
> Hmm... shouldn't the compiler complain then? (about the program above)

Maybe this piece of 2012 support is not yet implemented. With some changes,

with Ada.Text_IO;

    procedure Test2 is

       package IO renames Ada.Text_IO;

       -- type T is tagged;
       -- function F (E : T'Class) return Character;

       package Wrap is

          type T
             is tagged record
             F : Character := 'A';
          end record;

          function F
            (E : T'Class; Dummy : Boolean) -- or E : T; ...
            return T
             is (T'(F => 'B'));

       end wrap;


       E : Wrap.T;
       C : Character := E.F; -- The function or the field?
    begin
       IO.Put (C);
       E := E.F (Dummy => True);
    end;

I get

GNAT GPL 2012 (20120509)
Copyright 1992-2012, Free Software Foundation, Inc.

Compiling: test2.adb (source file time stamp: 2012-10-22 10:31:50)

    29.        E := E.F (Dummy => True);
                     |
        >>> name in call is not a callable entity

 30 lines: 1 error
gnatmake: "test2.adb" compilation error




  reply	other threads:[~2012-10-28  2:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-21 22:55 Basic issue with dotted notation and tagged types Yannick Duchêne (Hibou57)
2012-10-22  7:46 ` J-P. Rosen
2012-10-22  8:02   ` Dmitry A. Kazakov
2012-10-22 13:46     ` Yannick Duchêne (Hibou57)
2012-10-22 10:52   ` Marius Amado-Alves
2012-10-22 11:18     ` Georg Bauhaus [this message]
2012-10-22 11:37       ` Marius Amado-Alves
2012-10-22 14:11       ` Yannick Duchêne (Hibou57)
2012-10-22 11:45     ` Niklas Holsti
2012-10-22 14:17       ` Maciej Sobczak
2012-10-22 13:50     ` Yannick Duchêne (Hibou57)
2012-10-22 10:41 ` AdaMagica
replies disabled

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