[fpc-devel] Bug in FPC and declaring distinct types

Marco van de Voort marcov at stack.nl
Thu Sep 18 10:44:36 CEST 2008


In our previous episode, Michael Van Canneyt said:
> And it is also very annoying because
> 
> Type
>   MyString = type string;
> 
> Const
>   AString = 'something';
> 
> Var
>   M : MyString;
> 
> begin
>   M:=AString;
> end.
> 
> Will no longer compile if you are too strict. They should at least remain 
> assignment compatible. Delphi does the best it can, FPC should maybe be
> a bit more strict - it should not allow the var parameter.

Well, IMHO that is the idea! So that you can e.g. declare a UTF8string that
way (in pre Tiburon land), and get compiler errors on the spot where you
need to call conversion routines.

But I agree it works poorly. In both.



More information about the fpc-devel mailing list