From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10886 invoked by alias); 29 Nov 2008 09:09:14 -0000 Received: (qmail 10735 invoked by uid 48); 29 Nov 2008 09:07:53 -0000 Date: Sat, 29 Nov 2008 09:09:00 -0000 Subject: [Bug ada/38315] New: Unclear type error message when inheriting from interface and tagged type X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fraser at thewhitelion dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg02540.txt.bz2 Example code at the end. When I compile it, I get this error: [fraser@kimba]$ gcc -c unclear_override.ads unclear_override.ads:13:20: not subtype conformant with operation inherited at line 11 unclear_override.ads:13:20: type of "Item" does not match The problem is that in real life, Interface_1, Abstract_1 and Abstract_2 were all in different packages, and I'd just added Interface_1 but was not aware that Proc was also declared in Abstract_1. Since the error message made no mention of Abstract_1, nor that Proc was inherited from two places, it was difficult to diagnose this problem -- clearly the type of Item *does* match (so I thought). Would it be possible to add a reference in the error to the specific declaration that causes the type error? I.e. the declaration of Proc for Abstract_1. package Unclear_Override is type Interface_1 is interface; procedure Proc (Item : access Interface_1) is abstract; type Abstract_1 is abstract tagged null record; procedure Proc (Item : not null access Abstract_1) is abstract; type Abstract_2 is abstract tagged null record; type Definite_1 is new Abstract_1 and Interface_1 with null record; procedure Proc (Item : access Definite_1); end Unclear_Override; -- Summary: Unclear type error message when inheriting from interface and tagged type Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: minor Priority: P3 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: fraser at thewhitelion dot org GCC target triplet: x86_64-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38315