There seems to be a misconception in the implementation of PDT that the type parameters are (in part) just regular components of the type, so that for type foo(a) integer, len :: a end type type(foo(a)) :: array(9) the type inquiry array%a should give a rank-1 array of size 9. This is incorrect. Type parameters are not components of the type. The F08 standard clearly distinguishes between type parameter definition statements and component definition statements. See R425, R431, R435, and in particular see Note 6.7 which says "It [array%a, for example] is scalar even if designator is an array." Here's a test case that should pass. GFortran will bail on both stop lines. type :: vector(dim,kind) integer, len :: dim integer, kind :: kind end type type(vector(3,1)) :: a(10) if (size(shape(a%dim)) /= 0) stop 1 if (size(shape(a%kind)) /= 0) stop 2 end
Confirmed.
Created attachment 50636 [details] Fix for the PR Sorry for the wait. Your analysis is completely correct. Thanks for pointing it out. The attached will be submitted to the fortran list in a few minutes. It regression tests OK. Paul