Damian Rouson
2018-08-09 21:36:45 UTC
gfortran 6.4, 7.3, and 8.2 all produce the error message below when
attempting to use a renamed type in the same scope as the variable that
motivated the renaming:
$ cat foo.f90
module foo
type config
end type
end module
use foo, only: foo_config => config
contains
subroutine cap
integer config
type(foo_config) extra
end subroutine
end
$ gfortran foo.f90
foo.f90:9:26:
integer config
2
type(foo_config) extra
1
Error: The type ‘config’ cannot be host associated at (1) because it is
blocked by an incompatible object of the same name declared at (2)
$ gfortran --version
GNU Fortran (GCC) 8.2.0
attempting to use a renamed type in the same scope as the variable that
motivated the renaming:
$ cat foo.f90
module foo
type config
end type
end module
use foo, only: foo_config => config
contains
subroutine cap
integer config
type(foo_config) extra
end subroutine
end
$ gfortran foo.f90
foo.f90:9:26:
integer config
2
type(foo_config) extra
1
Error: The type ‘config’ cannot be host associated at (1) because it is
blocked by an incompatible object of the same name declared at (2)
$ gfortran --version
GNU Fortran (GCC) 8.2.0