J3/04-411 Date: 20 Oct 2004 To: J3 From: Rob James Subject: Abstract types in CLASS IS type guard statements NUMBER: TITLE: Abstract types in CLASS IS type guard statements KEYWORDS: ABSTRACT, CLASS IS, type guard, SELECT TYPE DEFECT TYPE: STATUS: J3 consideration in progress QUESTION: Consider the following program: PROGRAM foo TYPE, ABSTRACT :: base INTEGER i END TYPE TYPE, EXTENDS(base) :: child INTEGER j END TYPE CLASS(*), POINTER :: x TYPE(child), TARGET :: c1 x => c1 SELECT TYPE (x) CLASS IS (base) PRINT *, 'Class is base' CLASS DEFAULT PRINT *, 'Class is not base' END SELECT END Constraint C401 seems to prohibit the abstract type "base" from appearing in a CLASS IS type guard statement, thus prohibiting this program. There seems to be no reason to prohibit this, and allowing it seems to be useful in some situations. Was this program intended to be standard-conforming? ANSWER: Yes, this program was intended to be standard-conforming. An edit is provided to correct this oversight. EDITS: All edits refer to 04-007. [33:12] After "(4.5.6)", insert "unless it appears in a CLASS IS type guard statement (8.1.5.1)". SUBMITTED BY: Rob James HISTORY: 04-411 m170 Submitted