comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Profile mismatch?
Date: Thu, 13 Mar 2014 12:06:40 +0000
Date: 2014-03-13T12:06:40+00:00	[thread overview]
Message-ID: <ly4n327167.fsf@pushface.org> (raw)

Given the code below

   package Profile is
      type A1 is abstract tagged limited null record;
      procedure P (This : not null access A1);
      type A2 is abstract new A1 with null record;
      procedure P (This : access A2);              -- mismatch
      type T1 is new A1 with null record;
      procedure P (This : access T1);              -- mismatch
      type T2 is new A2 with null record;
      procedure P (This : not null access T2);     -- mismatch
      type T3 is new T2 with null record;
      procedure P (This : access T3);              -- mismatch
   end Profile;

should a compiler recognise the mismatches of the null exclusions where
indicated?

GNAT (4.8, 4.9, GPL 2013) accepts this code without comment. I've seen
very similar cases (structurally, but with many more subprograms) which
GNAT didn't accept, saying

   not subtype conformant with operation inherited at line 42
   type of "This" does not match

I've not yet tried to track this down.

             reply	other threads:[~2014-03-13 12:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 12:06 Simon Wright [this message]
2014-03-13 14:53 ` Profile mismatch? adambeneschan
2014-03-13 16:35   ` Simon Wright
2014-03-13 17:38     ` adambeneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox