public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/38315]  New: Unclear type error message when inheriting from interface and tagged type
@ 2008-11-29  9:09 fraser at thewhitelion dot org
  0 siblings, 0 replies; only message in thread
From: fraser at thewhitelion dot org @ 2008-11-29  9:09 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-29  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-29  9:09 [Bug ada/38315] New: Unclear type error message when inheriting from interface and tagged type fraser at thewhitelion dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).