From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86c76377d1077f30,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.germany.com!feeder.news-service.com!news.astraweb.com!newsrouter-eu.astraweb.com!proxad.net!cleanfeed2-b.proxad.net!nnrp8-2.free.fr!not-for-mail Message-Id: <44c94166$0$11790$626a54ce@news.free.fr> From: Yves Bailly Subject: Casting from interface type Newsgroups: comp.lang.ada Date: Fri, 28 Jul 2006 00:42:43 +0200 User-Agent: KNode/0.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Organization: Guest of ProXad - France NNTP-Posting-Date: 28 Jul 2006 00:42:46 MEST NNTP-Posting-Host: 81.56.171.53 X-Trace: 1154040166 nnrp8-2.free.fr 11790 81.56.171.53:35675 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:5973 Date: 2006-07-28T00:42:46+02:00 List-Id: 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 | //\ \_/ | | \_/`