mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 01:49:20 +02:00

before the change order was (from better to worse): shortstring, ansistring, widestring, unicodestring now the order is (from better to worse): widestring, unicodestring, ansistring, shortstring git-svn-id: trunk@20907 -
55 lines
834 B
ObjectPascal
55 lines
834 B
ObjectPascal
{$ifndef bigfile}
|
|
{$ifdef fpc}
|
|
{$mode delphi}
|
|
{$else fpc}
|
|
{$define FPC_HAS_TYPE_EXTENDED}
|
|
{$endif fpc}
|
|
{$endif bigfile}
|
|
|
|
type
|
|
{$ifdef FPC_COMP_IS_INT64}
|
|
comp142 = double;
|
|
{$else FPC_COMP_IS_INT64}
|
|
comp142 = comp;
|
|
{$endif FPC_COMP_IS_INT64}
|
|
procedure test142(a: shortstring); overload;
|
|
begin
|
|
writeln('shortstring called instead of widestring');
|
|
halt(1)
|
|
end;
|
|
|
|
procedure test142(a: widestring); overload;
|
|
begin
|
|
writeln('widestring called instead of shortstring');
|
|
end;
|
|
|
|
var
|
|
x142: shortstring;
|
|
|
|
y142: widestring;
|
|
procedure dotest142;
|
|
var
|
|
v: variant;
|
|
|
|
begin
|
|
try
|
|
v := x142;
|
|
test142(v);
|
|
except
|
|
on E : TObject do
|
|
halt(1);
|
|
end;
|
|
|
|
try
|
|
v := y142;
|
|
test142(v);
|
|
except
|
|
on E : TObject do
|
|
halt(1);
|
|
end;
|
|
end;
|
|
|
|
{$ifndef bigfile} begin
|
|
dotest142;
|
|
end. {$endif not bigfile}
|