Casting from interface type
- From: Yves Bailly <kafka.fr@xxxxxxxxxxx>
- Date: Fri, 28 Jul 2006 00:42:43 +0200
Hello all,
Please consider this small code :
--8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<---
procedure Proc is
type I is interface;
type T is tagged null record;
type DT is new T and I with null record;
var_t: T;
var_tc: T'Class := var_t;
procedure Conv(p: in I'Class) is
begin
if p in T'Class
then
var_t := T(p);
var_tc := T'Class(p);
end if;
end Conv;
var_dt: DT;
begin
Conv(var_dt);
end Proc;
--8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<---
Using the latest GNAT 2006, I receive the following errors:
proc.adb:14:19: invalid tagged conversion, not compatible with
type "I'Class" defined at line 3
proc.adb:15:21: invalid tagged conversion, not compatible with
type "I'Class" defined at line 3
Please, can someone tell me what am I doing wrong ?
Thanks in advance for your time.
Best regards,
--
(o< | Yves Bailly : http://kafka-fr.net | -o)
//\ | Linux Dijon : http://www.coagul.org | //\
\_/ | | \_/`
.
- Follow-Ups:
- Re: Casting from interface type
- From: Jeffrey R. Carter
- Re: Casting from interface type
- From: Adam Beneschan
- Re: Casting from interface type
- Prev by Date: Re: How do I acquire information about non-standard library Ada packages
- Next by Date: Re: Why people wants to complicate code with Ada.Unchecked_Deallocation?
- Previous by thread: Re: Compilation on Vax with script files
- Next by thread: Re: Casting from interface type
- Index(es):