[Lazarus] Lazarus in trunk not working after Rev 50151 on MacOSX
lazarus at kluug.net
Tue Nov 3 19:37:04 CET 2015
On 03.11.2015 17:34, Mattias Gaertner wrote:
> codetools use only a simple heuristic to calculate the type of a
> binary operator.
> The function TFindDeclarationTool.CalculateBinaryOperator needs to be
> extended for Alias types (e.g. 'integer' instead of longint) and for
> ranges (e.g. if the operands do not fit into an integer).
Maybe you are talking about the same, but just to be sure: IMO using
hard-coded alias types is not a good idea (theoretically the user can
redefine them). Instead the type evaluation should go to the end type
(e.g. from Integer to *longint*) and then the end types should be
compared. The comparison can then be done with a hard-coded table (you
need it only for the basic types, so it is OK and safe) and the type
that wins, will be used as the result type (obviously the originally
Res := I + S;
I = (Integer -> longint)
S = SmallInt
ResultBasicType = Compare(longint, SmallInt) -> longint -> I
ResultType = ResultBasicType -> I -> *Integer*
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus