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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, WEIRD_QUOTING autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,908d00bc809f8627,start X-Google-Attributes: gid103376,public From: Thorbergur Olafsson Subject: Anyone who recognizes this errormsg? Date: 1996/04/10 Message-ID: <316C06C2.7E54@tufvan.hv.se>#1/1 X-Deja-AN: 146775468 content-type: text/plain; charset=us-ascii organization: Say What mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0GoldB1 (Win95; I) Date: 1996-04-10T00:00:00+00:00 List-Id: Hi, I'm having problems comparing two own defined types with "=". When I compile the code I get following error messages: mote_obj.adb:128:24: ambiguous expression (cannot resolve ""="") mote_obj.adb:128:24: possible interpretation at mote_obj.ads:32 mote_obj.adb:128:24: possible interpretation at mote_obj.ads:54 ... etc. with same errormsg. elsewhere. The relevant code is : ------------------------------- -- mote_obj.ads (MEETING_OBJ)-- ------------------------------- package mote_obj is ... type Time is tagged record Hour : Hour_in_one_Day; Minut : Minutes_in_one_Hour; end record; type Date is tagged record Year : Year_int; Month : Month_int; Day : Day_int; end record; ... type MEETING_TYPE is private; type MEETING_Start is new Time with null record; type MEETING_Finish is new Time with null record; type MEETING_Date is new Date with null record; ... function getStart ( M : MEETING_TYPE) return MEETING_Start; function getFinish( M : MEETING_TYPE) return MEETING_Finish; function getDate ( M : MEETING_TYPE) return MEETING_Date; ... function "=" ( A, B : Time'Class) return Boolean; -- true if A = B function "=" ( A, B : Date'Class) return Boolean; function "=" ( A, B : MEETING_TYPE)return Boolean; ... private type MEETING_TYPE is record StartTime : MEETING_Start; FinishTime: MEETING_Finish; Day : MEETING_Date; ... end record; ... end mote_obj; ------------------------------- -- mote_obj.adb (MEETING_OBJ)-- ------------------------------- package body mote_obj is ... function getStart ( M : MEETING_TYPE ) return MEETING_Start is begin return M.StartTime; end getStart; function getFinish( M : MEETING_TYPE ) return MEETING_Finish is begin return M.FinishTime; end getFinish; function getDate( M : MEETING_TYPE ) return MEETING_Date is begin return M.Day; end getDate; ... function "="( A, B : Time'Class) return Boolean is (2) begin return A.Hour = B.Hour and A.Minut = B.Minut; end "="; function "="( A, B : Date'Class) return Boolean is (3) begin return A.Year = B.Year and A.Month = B.Month and A.Day = B.Day; end "="; ... function "=" ( A, B : MOTE_TYP) return Boolean is begin return getDate(A) = getDate(B) and (1) getStart(A)= getStart(B) and (1b) getFinish(A)=getFinish(B); (1c) end "="; ... end MOTE_OBJ; (1) This is line 128 in the code and it is the "=" the compiler complains about. It also complains about the "=" in (1b) and (1c). (1) calls (att least should call) (3) (1b) and (1c) call (2). -- Is there anyone who knows what is wrong here or is there anyone who recognizes this. Answer appreciated both to newsgroups and through e-mail. Thanx in advance!