[Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Nov 4 02:14:04 CET 2015


On Tue, 3 Nov 2015 20:34:30 +0100
Ondrej Pokorny <lazarus at kluug.net> wrote:

> 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.

Good.

 
> 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.

Left side wins.
It can't be perfect, but it should be deterministic.

Mattias




More information about the Lazarus mailing list