Problem with generic interfaces.
Steve Kargl
sgk@troutmask.apl.washington.edu
Wed Nov 3 05:16:00 GMT 2010
On Wed, Nov 03, 2010 at 06:07:21AM +0100, Paul Richard Thomas wrote:
> > I have started to get problems with my generic interfaces, with
> > gfortran downloaded from
> > ftp://ftp.equation.com/gcc/gcc-4.6-20101030-32.exe.
> >
> > I have come to the conclusion that the problem might be related to
> > interfaces where I in the procedures have mixed a type and types
> > extended from that type.
> >
> > My question is then, is the following code legal?
>
> No, gfortran tells you:
> gunnar.f90:9.37:
>
> module procedure testa_a, testa_b
> 1
> Error: Ambiguous interfaces 'testa_b' and 'testa_a' in generic
> interface 'testa' at (1)
> gunnar.f90:24.9:
>
> use test
> 1
> Fatal Error: Can't open module file 'test.mod' for reading at (1): No
> such file or directory
>
> ifort opines:
> gunnar.f90(30): error #8032: Generic procedure reference has two or
> more specific procedure with the same type/rank/keyword signature.
> [TESTA]
> call testa(b)
> --------^
> compilation aborted for gunnar.f90 (code 1)
>
> >
> > (I can solve my problem by using type instead of class for my
> > declarations in the subroutines.)
> >
>
> Indeed. The ambiguity arises because instances of CLASS(a) can be of
> CLASS(b). Which of test_a and test_b should chosen in this case?
>
> Cheers
>
Isn't this a TKR issue? TKR = type, kind, rank. A CLASS is not
a type, kind, or rank.
--
Steve
More information about the Fortran
mailing list