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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.40.4 with SMTP id o4mr23865641ioo.75.1499132180813; Mon, 03 Jul 2017 18:36:20 -0700 (PDT) X-Received: by 10.36.23.213 with SMTP id 204mr929243ith.8.1499132180776; Mon, 03 Jul 2017 18:36:20 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!v202no935631itb.0!news-out.google.com!k7ni7747itk.0!nntp.google.com!v202no935627itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 3 Jul 2017 18:36:20 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:1205:5055:3750:29e9:f809:ee38:4b5f; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 2a02:1205:5055:3750:29e9:f809:ee38:4b5f References: <82a59ee9-8d55-4c73-9daf-e9f7d9ab8a8f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: derived formal types and known discriminants From: gautier_niouzes@hotmail.com Injection-Date: Tue, 04 Jul 2017 01:36:20 +0000 Content-Type: text/plain; charset="UTF-8" Xref: news.eternal-september.org comp.lang.ada:47272 Date: 2017-07-03T18:36:20-07:00 List-Id: "construction for an abstract parent type": just a wild guess: you would perhaps do something like this: type T is abstract tagged record i: Integer:= 1; end record; procedure Reset (x: in out T) is fresh_new: T; -- GNAT: type of object cannot be abstract begin x:= fresh_new; -- GNAT: target of assignment operation must not be abstract end; ...and you are blocked at the lines with comments. Then a solution is a non-abstract grand-parent type: type Pre_T is tagged record i: Integer:= 1; end record; type T is abstract new Pre_T with null record; procedure Reset (x: in out T) is fresh_new: Pre_T; begin Pre_T(x):= fresh_new; end; HTH... _____________________________________________________________ A free online game in Ada: http://pasta.phyrama.com/game.html