Community
Participate
Working Groups
When refactoring, the Extract Procedure action omits a length specifier for character dummy arguments of the new procedure, giving them an implicit length of one. Consider the following example code: program refactor implicit none character(3) :: charvar charvar = 'abc' print *, charvar end program refactor This prints the string 'abc'. Now select the line with the print statement and click 'Refactor > Extract Procedure...'. Complete the dialog and you'll end up with the following: program refactor implicit none character(3) :: charvar charvar = 'abc' call printcharvar(charvar) contains subroutine printcharvar(charvar) implicit none character :: charvar print *, charvar end subroutine end program refactor As you can see, the subroutine has a dummy character argument with length one. So it only prints the first character, instead of all three.
Created attachment 174178 [details] ExtarctProcedure character length bug fixed
Created attachment 174224 [details] Patch to correct ExtractProcedure
Created attachment 179336 [details] Modified patch - added unit test, copied in entire char selector
Patch committed to HEAD for 7.0. Still need to commit to PTP_4_0 for 6.0.4.
This didn't make 6.0.4, but it will be in 6.0.7. Patch committed to ptp_4_0 branch.