[fpc-devel] Bug in FPC and declaring distinct types
Florian Klaempfl
florian at freepascal.org
Thu Sep 18 15:55:50 CEST 2008
Graeme Geldenhuys schrieb:
> On Thu, Sep 18, 2008 at 3:40 PM, Florian Klaempfl
> <florian at freepascal.org> wrote:
>>>> What rule do you apply to say this?
>>> Compiler treats '1234' as ansistring constant. Therefore ansistring
>>> overload must be choosen here.
>> No, '1234' is taken as generic string constant.
>
> And which type is a generic string?
It has no particular type, guess why FPC internally has this:
tconststringtype = (
cst_conststring,
cst_shortstring,
cst_longstring,
cst_ansistring,
cst_widestring,
cst_unicodestring
);
Without any further code, the type 'asdf' is not defined, $H means only
ansistring might be prefered.
> When compiled with {$mode objfpc}{$H+}
> I would have thought ansistring? Well, at least that is how I
> understood the $H directive.
>
> Either way, I still think FPC and Delphi is broken (FPC more so than
> Delphi) with regards to distinct type declarations.
I can't help you if you don't get what "= type ..." actually means :)
More information about the fpc-devel
mailing list