Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!src.dec.com!kalsow From: kalsow (Bill Kalsow) Newsgroups: comp.lang.modula3 Subject: Re: OBJECTs and their default methods Message-ID: <9105071603.AA12562@jumbo.pa.dec.com> Date: 7 May 91 16:03:42 GMT Lines: 19 In-Reply-To: Message of 24 Apr 91 19:20:15 GMT from buschman@tubsibr.uucp (Andreas Buschmann) <1991Apr24.192015.13327@tubsibr.uucp> To: m3 Cc: buschman@tubsibr.uucp (Andreas Buschmann), kalsow > suppose we have the following declarations: > > TYPE O1 = OBJECT METHODS m () : INTEGER := zehn END; > TYPE O2 = O1 OBJECT m : INTEGER := 2 END; > > PROCEDURE zehn (self : O1): INTEGER = > BEGIN RETURN 10; END zehn; Then, "O2.m" is illegal. Page 13 of the report says A field or method in a subtype masks any field or method with the same name in a supertype. So, if anything O2.m would name the INTEGER field, but the report does not attach a meaning to "ObjectType.Field". The lack of an error message when you try to use "O2.m" is a compiler bug. - Bill Kalsow