Hi!
Jo Dillon wrote:
Compiler error:
gpc -g -c -w babyunit.pas gpc -g -c -w baby.pas baby.pas: In function `program_Baby': baby.pas:10: incompatible types in assignment
It looks to be a problem with having the same identifier used in two enumerations;
Indeed. The declaration in the program supersedes that one coming from the unit. From this point of view, the type mismatch is justified.
if those two enumerations are in the same unit a more informative error message results, such as:
baby.pas:7: conflicting types for `Beetle' baby.pas:6: previous declaration of `Beetle'
Here the declarations appear in the same name space, so you have indeed given two meanings to the same identifier.
Any ideas? Is this a compiler bug?
I think that GPC behaves correctly. Am I overlooking something?
Peter