Possible error message improvement?
Tilo Schwarz
tilo@tilo-schwarz.de
Fri Apr 12 21:29:00 GMT 2013
Hi,
today gfortran fooled my with this error message:
[...]
call process(f, m)
1
Error: Type mismatch in argument 'm' at (1); passed CLASS(measurement) to
CLASS(measurement)
It took me a while to figure out what's going on here:
I had two (different) types defined in two different module files with the
same name.
The compiler was right, I wanted to move a derived type but actually
copied it and then modified it.
If something like this happens in the same source, I get
[...]
Error: Derived type definition of 't' at (1) has already been defined
types.f95:7.3:
What do you think about adding a hint like
"You might have defined two different types with the same name"
if and only if the types have the same gfc_typename()? (I would do a
patch.)
(or any other, better line, suggestions welcome)
Or do errors always have to be one line?
Another possibility would be to mention the different modules the types
came from.
Regards,
Tilo
More information about the Fortran
mailing list