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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8f37203cc7858734,start X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Is assignment available for access parameters? Date: 1997/03/26 Message-ID: #1/1 X-Deja-AN: 228446653 Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-03-26T00:00:00+00:00 List-Id: Is assignment of an access parameter to an object of a named (general) access type legal? The code below compiles under my compiler (GNAT), but not on others (Rational, Aonix). Who is correct? My expectation is that the assignment be illegal, because the type is anonymous. This would be analogous to the rule that types that have an access discriminant must be limited. (Of course, with a type conversion, then the assignment can be made legal.) But I'm not sure. RM95 5.2 (4) states that the "expected type for the expression [on the RHS] is the type of the target." Is an access parameter implicitly converted to the target type? -- STX package P is type T is tagged null record; type TA is access all T'Class; end; with P; procedure Test_P is procedure Proc (OA : access P.T) is OTA : P.TA := OA; -- ??? begin null; end; begin null; end; -- ETX Matt -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271