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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dae16e5441382930,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-04 12:42:23 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!teaser.fr!fr.clara.net!heighliner.fr.clara.net!news000.worldonline.se!newsfeed01.se.dataphone.net!nntp.se.dataphone.net!news.powertech.no!nntp.newmedia.no!newsfeed1.enitel.no!news.ost.eltele.no!news2.oke.nextra.no!nextra.com!news3.oke.nextra.no.POSTED!not-for-mail Reply-To: "Frank" From: "Frank" Newsgroups: comp.lang.ada Subject: type mismatches/access type X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Sun, 4 Mar 2001 21:35:09 +0100 NNTP-Posting-Host: 130.67.134.252 X-Complaints-To: news-abuse@nextra.no X-Trace: news3.oke.nextra.no 983738396 130.67.134.252 (Sun, 04 Mar 2001 21:39:56 MET) NNTP-Posting-Date: Sun, 04 Mar 2001 21:39:56 MET Organization: Nextra Public Access Xref: supernews.google.com comp.lang.ada:5411 Date: 2001-03-04T21:35:09+01:00 List-Id: Hi! I have downloaded the source code for the ADEPT projekt (on AdaPower w-page). There is a package that is a part of the "jxtrans" program in there that I get a compilation error on, code snippet (of what I believe is important :-) follows: The compiler is very frustrated by the use of the "=" operator and the error message is as follows: gnatgcc -c -gnatf jxt_list.adb jxt_list.adb:26:19: invalid operand types for operator "=" jxt_list.adb:26:19: left operand has type access to "Element_T'Class" defined at jxt_list.ads:23 jxt_list.adb:26:19: right operand has an access type jxt_list.adb:33:26: expected type "Element_p" defined at jxt_list.ads:21 jxt_list.adb:33:26: found type access to "Element_T'Class" defined at jxt_list.ads:23 jxt_list.adb:34:26: expected type "Element_p" defined at jxt_list.ads:21 jxt_list.adb:34:26: found type access to "Element_T'Class" defined at jxt_list.ads:23 jxt_list.adb:38:31: expected type "Element_p" defined at jx...... asf on several places. I have tried to replace the use of "access Element_t'Class;" in the package and used the "Element_p" instead. Then this package compiles, but then another package depending on this one get in trouble instead. Is there some way to convince the compiler that Element can be "null"? or does anyone have a suggestion as to why I get this error; after all, the package has compiled on Solaris... spec part .... ... type Element_t is tagged private; type Element_p is access all Element_t'class; procedure Add (Element : access Element_t'Class; List : List_p); procedure Remove (Element : access Element_t'Class); body part: package body JxT_List is ---------------------------- -- Add -- ---------------------------- -- Public -- Adds an element to a list. -- procedure Add (Element : access Element_t'Class; List : List_p) is begin if (Element = null) then <-----------------Compiler reports error ln:26 null; else if (Element.List /= null) then Remove (Element); end if; if (List.Num_Elems = 0) then List.Head := Element; <--------------Compiler reports error ln:33 List.Tail := Element; Element.Next := null; Element.Prev := null; else .... ... ...