[Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX
Ondrej Pokorny
lazarus at kluug.net
Tue Nov 3 20:34:30 CET 2015
On 03.11.2015 20:26, Mattias Gaertner wrote:
>> procedure Test;
>> >var
>> > I: Integer;
>> > S: SmallInt;
>> >begin
>> > Res := I + S;
>> >end;
>> >
>> >Something like:
>> >1.)
>> >I = (Integer -> longint)
>> >S = SmallInt
>> >2.)
>> >ResultBasicType = Compare(longint, SmallInt) -> longint -> I
>> >3.)
>> >ResultType = ResultBasicType -> I ->*Integer*
> That would fail with the following example:
>
> var
> i: SizeInt;
> j: SmallInt;
> begin
> k:=i+j;
> end;
>
> The result should be SizeInt, not Integer.
No, the result will be SizeInt, because (SizeInt -> LongInt) wins over
SmallInt and the result thus will be SizeInt (as the original type alias
of /*i*/) and not Integer.
A problem could be with such code:
var
i: SizeInt;
j: Integer;
begin
k:=i+j;
end;
Because obviously on 32bit SizeInt=longint and Integer=longint, so there
won't be a deterministic way which type wins.
Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151103/70cfc62a/attachment-0003.html>
More information about the Lazarus
mailing list