This test case is invalid. It is rejected with an error message that is nonsense in this context. program test implicit none type line_struct integer :: width = 10 end type type symbol_struct integer :: typee = 10 end type type curve_struct type (line_struct) line type (symbol_struct) symbol end type type (curve_struct) curve namelist / params / curve ! open (1, file = 'test.nml') read (1, nml = params) print *, curve(1)%symbol%typee end program $ gfc -g test.f90 test.f90:20.17: namelist / params / curve 1 Error: PROCEDURE attribute conflicts with NAMELIST attribute in 'curve' at (1) Another example is: program test2 implicit none type line_struct integer :: width = 10 end type type symbol_struct integer :: typee = 10 end type type curve_struct type (line_struct) line type (symbol_struct) symbol end type type (curve_struct) curve print *, curve(1)%symbol%typee end program $ gfc -g test2.f90 /tmp/ccuBUha0.o: In function `test': /home/jerry/prs/pr45532/pr45532.f90:20: undefined reference to `curve_' collect2: ld returned 1 exit status
I am not sure how to improve this (internally). NAG also prints: f95 hjf.f90 Error: hjf.f90, line 26: Inconsistent usage of CURVE detected at )@% Error: hjf.f90, line 26: Component of function reference detected at )@% However, the error location could be better - instead of pointing to the NAMELIST line, one could - as NAG, ifort and g95 do - point to the PRINT line, e.g. g95: print *, curve(1)%symbol%typee 1 Error: PROCEDURE attribute conflicts with NAMELIST attribute in 'curve' at (1)
Still present at revision 200122. I share the Tobias' opinion that it won't be easy to get a better error message. This PR should probably be closed as WONTFIX.
Agree.