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 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:2f43:: with SMTP id v64mr12341179qkh.330.1586694761914; Sun, 12 Apr 2020 05:32:41 -0700 (PDT) X-Received: by 2002:a9d:6a48:: with SMTP id h8mr1011701otn.329.1586694761604; Sun, 12 Apr 2020 05:32:41 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 12 Apr 2020 05:32:41 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=85.204.137.153; posting-account=9DmjiwoAAAD-KD7MAll0qPzDsSqXm2Qs NNTP-Posting-Host: 85.204.137.153 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Generic oddness From: Per Jakobsen Injection-Date: Sun, 12 Apr 2020 12:32:41 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:58348 Date: 2020-04-12T05:32:41-07:00 List-Id: Declaring the package List_Type from Doubly_Linked_Lists gives me "abstract= subprogram not allowed as generic actual" unless I declare the "A_Intf" ty= pe in a package separate from the List_Type declaration, or if I instantiat= e a workaround (dummy) generic before (as in the below MWE): --- gnatchop --------------------- generic type A is private; package Gen is pragma Pure; end Gen; package Intf is type Intf_Type is interface; procedure Do_Stuff (I : in out Intf_Type) is abstract; end Intf; with Ada.Containers.Doubly_Linked_Lists; with Intf; with Gen; package Test is use Intf; type A_Intf is new Intf_Type with record A : Natural; end record; overriding procedure Do_Stuff (I : in out A_Intf); package Workaround is new Gen (A =3D> A_Intf); -- Commenting the above line will cause the -- next line to fail !?!? package List_Type is new Ada.Containers.Doubly_Linked_Lists (Element_Type =3D> A_Intf, "=3D" =3D> "=3D"); end Test; package body Test is overriding procedure Do_Stuff (I : in out A_Intf) is begin null; end Do_Stuff; end Test; --- gnatchop end --------------------- Unpack with gnatchop, then compile with gnatmake test.adb. Then comment the= Workaround package instantiation and recompile. Using GNATMAKE Community 2019 (20190517-83). Is there a sane explanation for this behavior? ~Per