[fpc-pascal] Is it possible to redefine FreePascal types?

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Nov 22 10:33:49 CET 2012


Jonas Maebe <jonas.maebe at elis.ugent.be> hat am 22. November 2012 um 10:03
geschrieben:
>
> On 22 Nov 2012, at 02:00, Kenneth Cochran wrote:
>
> > On Wed, Nov 21, 2012 at 5:34 PM, Graeme Geldenhuys
> > <graeme at geldenhuys.co.uk>wrote:
> >
> >> That is an incorrect assumptions. The compiler will happily accept
> >> both
> >> types without needing typecasting.
> >
> > I stand corrected. I assumed it behaved the same as Delphi in this
> > respect.
> > It doesn't, not even when Delphi mode is enabled.
>
> Delphi behaves like FPC, at least Kylix 3 does. Afaik the only use for
> "type newstring = type string;" is so that you can declare overloaded
> routines that are differentiated based on those two types.

Yes, for example you can ask the type via RTTI. For instance the LCL uses type
TTranslateString = string for all string properties that should be auto
translated.

Mattias



More information about the fpc-pascal mailing list