comp.lang.ada
 help / color / mirror / Atom feed
From: Per Jakobsen <pdj@knaldgas.dk>
Subject: SOLVED: Generic oddness
Date: Tue, 14 Apr 2020 02:42:10 -0700 (PDT)
Date: 2020-04-14T02:42:10-07:00	[thread overview]
Message-ID: <16e2c37d-eb5f-46a7-ad01-367721c4477f@googlegroups.com> (raw)
In-Reply-To: <874ktofymo.fsf@samuel>

søndag den 12. april 2020 kl. 18.38.11 UTC+2 skrev Ludovic Brenta:
> 
> The part that I don't understand is why you can instantiate Gen but not
> Doubly_Linked_Lists with the same actual type as parameter; I think the
> instantiation of Doubly_Linked_Lists should freeze the type A_Intf just
> like package Workaround does.

I believe I've found the explanation:
A friend reminded me that our mutual friend Jacob Sparre Andersen actually reported this problem back in Sep 2017 (ticket: Q904-007) which was reported fixed in June 2019.

The problem is the equality function required for Doubly_Linked_List. If I add a similar function parameter to the Gen generic, it fails as well.

Apparently the implicitly declared equality operator for a type implementing an Interface is treated as abstract until the type is frozen, which can be done in several different ways.

Anyway it seems to be a problem that has been fixed in the recent compiler, soon to be released in the Community Edition.

~Per

  reply	other threads:[~2020-04-14  9:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12 12:32 Generic oddness Per Jakobsen
2020-04-12 16:38 ` Ludovic Brenta
2020-04-14  9:42   ` Per Jakobsen [this message]
2020-04-12 18:11 ` 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