J3/99-101 Date: 2 Dec 98 To: J3 From: Richard Maine Subject: Interp. question on public components of private types NUMBER: TITLE: Public components of private types KEYWORDS: Accessibility, Derived Types, Components DEFECT TYPE: STATUS: J3 consideration in progress QUESTION: F90 interpretation 32 indicated that components of a derived type may be accessible even in scopes where the derived type name is inacessible. It added an edit to 12.1.2.2.1 of f90 (14.1.6.3 of f95) saying "If a derived type name of a host is inaccessible, data entities of that type or subobjects of such data entities can still be accessible." The discussions in the last 2 paragraphs of 4.4.1 of f95 appear to treat the accessibility of the derived type and its components as independent issues. Drafts of f2k added a note to make the independence clear. However, 14.1.2.5 of f95 says "If the type is accessible...and the definition of the type does not contain the PRIVATE statement (4.4.1), the component name is accessible...." This statement appears to make accessibility of the type a condition for accessibility of the component names, in contradiction with the above cited edit from f90 interpretation 32. The following code sample illustrates the issue. This sample works on several f90 compilers. module m type t integer :: i end type t type (t) :: a end module m program p use m, only: a a%i = 2 write (*,*) a%i end program p Question 1. Is it allowed to access public components of a derived type object when the type name is inaccessible as illustrated in the above sample code? Question 2. Should there be an edit in 14.1.2.5 of f95 to clarify this? ANSWER: EDIT: SUBMITTED BY: Richard Maine HISTORY: 99-101 m148 Submitted